A
antonyliu2002
Hi, guys,
I am using Visual Web Developer Express 2005 for my web application.
I wrote a simple class called MyTestClass.cs and put it in the App_Code
folder.
I compiled it to library from the DOS console using the command line
compiler csc and got a new file called MyTestClass.dll in App_Code.
Now, in the code-behind file Default.aspx.cs for Default.aspx, when I
try to define an object of MyTestClass, the IDE even shows
"MyTestClass" as an option in the live code-completion drop-down list.
This suggests that MyTestClass.dll has been properly recognized,
doesn't it?
But, when I test my web application, I still get this error message:
Compiler Error Message: CS0246: The type or namespace name
'MyTestClass' could not be found (are you missing a using directive or
an assembly reference?)
Line 9: using System.Web.UI.WebControls.WebParts;
Line 10: using System.Web.UI.HtmlControls;
Line 11: using MyTestClass;
Line 12:
Line 13:
If I comment out Line 11, I will get the same error message at line
where I define the MyTestClass object. It looks like that just because
the IDE recognizes a type or namespace doesn't mean the compiler knows
about it, right?
Mind I asking what is wrong? I know nothing about assembly yet. Will
assembly come to the rescue?
Thanks.
I am using Visual Web Developer Express 2005 for my web application.
I wrote a simple class called MyTestClass.cs and put it in the App_Code
folder.
I compiled it to library from the DOS console using the command line
compiler csc and got a new file called MyTestClass.dll in App_Code.
Now, in the code-behind file Default.aspx.cs for Default.aspx, when I
try to define an object of MyTestClass, the IDE even shows
"MyTestClass" as an option in the live code-completion drop-down list.
This suggests that MyTestClass.dll has been properly recognized,
doesn't it?
But, when I test my web application, I still get this error message:
Compiler Error Message: CS0246: The type or namespace name
'MyTestClass' could not be found (are you missing a using directive or
an assembly reference?)
Line 9: using System.Web.UI.WebControls.WebParts;
Line 10: using System.Web.UI.HtmlControls;
Line 11: using MyTestClass;
Line 12:
Line 13:
If I comment out Line 11, I will get the same error message at line
where I define the MyTestClass object. It looks like that just because
the IDE recognizes a type or namespace doesn't mean the compiler knows
about it, right?
Mind I asking what is wrong? I know nothing about assembly yet. Will
assembly come to the rescue?
Thanks.