HttpContext Error In Code Library

L

Leon

I'm Building a Code Library in VS.NET 2003 to be reference within my ASP.NET
web application.
However, within my Code Library I have an AppException.vb page that keep
receiving the following error when compiled:
Type 'HttpContext' is not defined

Take a look at the code:
' Get the current HTTPContext
Dim context As HttpContext = HttpContext.Current
Etc...

What I'm I doing wrong?
Do I have to do something special when it comes to creating a Code Library?
I tried the same code within my ASP.NET web application and it works?

Thanks
 
S

Scott Allen

HI Leon:

In the Project menu you have to 'Add Reference' to the System.Web
assembly. Then in the vb file you need to Imports the System.WEb
namespace (or else fully qualify the call e.g.
System.Web.HttpContext).
 
L

Leon

I'm Sorry I did'nt explain throughtly, but I know I must add a reference
with in the project, I also know
to import the system.web namespace within the code library, but I still
continue to get the error within my code Library project.
Thanks for trying Scott!
 
S

Scott Allen

Hi Leon:

You might want to double check the project reference and the Imports
statement. Those are the only two steps to getting the type recognized
by the compiler (unless something else is drastically wrong).
 
G

Guest

Leon:

Did you ever get this resolved? I ran into the same problem onmy development machine. I fixed it by manually adding theSystem.Web reference to my assembly even though in ObjectBrowser I already had a System.Web object. This one isdifferent and should point toC:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Web.dll orsimilar.

Tom
User submitted from AEWNET (http://www.aewnet.com/)
 
G

Guest

Leon:

Did you ever get this resolved? I ran into the same problem onmy development machine. I fixed it by manually adding theSystem.Web reference to my assembly even though in ObjectBrowser I already had a System.Web object. This one isdifferent and should point toC:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Web.dll orsimilar.

Tom
User submitted from AEWNET (http://www.aewnet.com/)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top