Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# Compiling Problems....

Status
Not open for further replies.

NeilV

Programmer
Oct 14, 2002
117
GB
Hello,

I am having difficulty getting a C# class to compile- i get the following error:
"The type or namespace name 'Web' does not exist in the class or namespace 'Microsoft' (are you missing an assembly reference?)"

in my code i have:
using Microsoft.Web.UI.WebControls;

so i assume its refering to that. I can however get my code to compile in an aspx file in the following way:
&quot;<%@ Register TagPrefix=&quot;IE&quot; Namespace=&quot;Microsoft.Web.UI.WebControls&quot; Assembly=&quot;Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; %>&quot;

How do i get my class to compile, do I need to set a reference when using the csc compiler??

Neil

PS I'm not using Visual Studio so I can't set the reference in there.
 
Actually you just need to change that reference alittle. Web Controls doesn't exist under the Microsoft namespace.
The correct namespace is.
System.Web.UI.WebControls That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
You have to use the addReference command in the compiler to add the reference to that assembly. As I only use VS, I'm not able to give you specifics, but if you look up that command, you should get set back on the straight and narrow.

-paul
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
ok,
I managed to get my class to compile - i needed to add the reference when compiling ( thanks link9). But now, rather embarrassingly, I can't actually use my class! I assumed that after I compiled it into a DLL i could use it by simply adding the following to my aspx page:
<%@ import Namespace =&quot;Menu&quot; %>
both my dll and class are called menu, however, I get the missing assembly reference error again. As this a aspx file i can't compile it from the command line.

Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top