Moving code to a vb.net class library

  • Thread starter Thread starter chanmmn
  • Start date Start date
I'm moving some code from my asp.net application into a vb.net library so it
can be reused easily elsewhere. I have a vb class in my asp.net application
and I just took a copy of that file and made it a new class in a new VS.net
class library.

Now when I look at my new class in my new library, several of the imports
statements are being flagged by intellisense as invalid (that work fine in
the asp.net app). It looks to be any system.web namespace. The first being
system.web.HttpContext. Are these namespaces available in a Class Library?
Do I need to handle my imports differently? Not sure where to go from here
to make this code portable. Thanks!

Matt
 
Imports are just shortcuts, so you type less. You are missing some assembly
references in your project - probably like System.Web, etc. ASP.NET apps
have templates that include some of these assemblies as references by
default, where as a library would not have them there by default.
 
Got it. Thanks!
I figured it was some kind of reference, but didn't know where to look to
add it.
 
Back
Top