Moving code to a vb.net class library

  • Thread starter Thread starter chanmmn
  • Start date Start date
C

chanmmn

Make sure the right References has choosen for the project.

chanmm
 
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.
 

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

Back
Top