System.Web.UI namesspace compile time error

I am getting this error out of "using System.Web.UI;" declaration:

The type or namespace name UI does not exist in the class or namespace 'System.Web' (are you missing an assembly reference ).

I am using Visual Studio 2003 C# .NET designer. My system is Win2K Pro.

I want to ultimately use class TableDesigner in my application.  Accoring to the .NET Framework Class Library the requirement for TableDesigner class is NAMESPACE (!) System.Web.UI.Design.WebControls.

In the assembly I should have "using System.Design;" statement. When I put it in it also gives me an error of the same nature that 'Design' is not recognized in 'System' namespace. The System.Design should be in System.Design.dll according to the same MS page. I could not find such dll in my computer. There is a directory 'C:\WINNT\assembly' where I found a file System.Design. I could not determine the file extension. There are many files related to MS Visual Studio in there.

Where am I making a mistake

Thanks.


Answer this question

System.Web.UI namesspace compile time error

  • LDesmons

    If you open the references window of your project, you'll find an assembly called "System.Design.dll" in the list. This assembly contains the namespace System.Web.UI.Design.WebControls.

    Don't get confused - the name of an assembly (dll) and the namespaces it contains don't have to match.

  • Join

    Thank you very much. It is not the first time I have encountered a similar problem. Now your suggestion has opened up a totally new world for me.

  • FONTANA Guillaume

    Hi,

    The namespace System.Web.UI.Design.WebControls is part of the System.Design.dll - your finding is correct.

    For the using directive to work, you need to add reference to the DLL and for this in the VS IDE, select Add Reference and in the dialog box that comes up look for "System.Design.dll" and select that and add the reference.

    I just checked and this DLL does come up in the Add References Dialog Box in the .NET tab.

    Regards,
    Vikram

  • LogicalVue

    Here it is! The matter is completely resolved now. Thanks.

  • ruslan ovechkin

    Hi,

    The following PDF has a good pictorial walkthrough of adding a DLL as a reference to a Project:
    http://www.deitel.com/books/NET/AddingReferences.pdf

    Regards,
    Vikram


  • DevGuy_

    OK, it seems I overcame the System.Design problem. There is no namespace by this name, right but there should be a namespace System.Web.UI It is not in the menu. I cannot add it to my assembly. How can I get hold of this dll

    Am I totally confused

    The error I am getting now is that

    "the namespace UI does not exist in the class or namespace System.Web (are you missing an assembly reference )."

    There should be System.Web.UI namespace but the corresponding dll does not appear in the drop-down window of the "Add Reference" form.

    I checked C:\winnt\assembly\ directory and could not see a System.Web.UI.dll file in there either.

    What shall I do now

    Thanks.



  • SamD

    Vikram, sorry, something else is missing. I added the System.Design to Tools-->Macros-->Macros IDE-->My Macros. It did come up, yes. Now I can see it among references at the root: My Macros among other namespaces like System.Windows.Forms but the error still persists.

    Some other action is needed and I do no understand what it is.


    Thanks.

  • Don Brinn

    Thanks, very useful.

  • Navneet Gupta

    You need to add this reference to your application's project. In the Solution Explorer, right-click on your project and select Add Reference...
    Adding it to the IDE's macro references won't help.

  • gen

    System.Design has been in my assembly all along, sorry. I am still getting this error message, though.

    I mean it is among references in MyMacros-->References-->System.Design. It is there.

    Thanks.


  • System.Web.UI namesspace compile time error