Adding a reference

  • Thread starter Thread starter Chris Wertman
  • Start date Start date
C

Chris Wertman

I am rustier than I thought when it comes to Visual Studio and VB.NET
for the last year I have been writing only ASP.NET pages in inline
code and well I kinda forget how to add a reference , well sort
of.....

I am trying to add System.Net but it dosent show up when I right click
and try to select it from the refrences menu, in fact very few
assemblies I use show up there. I tried adding it to AssemblyInfo.vb
but that dosent seem to work either. I have to call it in this way

Dim objWebClient As New System.Net.WebClient

When I want to call it like this

Dim objWebClient As New WebClient

I had this problem when I first started using Visual Studio and I cant
remeber what I did to get around it. I tried searching on google but I
come up with to many results for my search.

Any help would be greatly appreciated.

Chris
 
Chris,

don't mix up "Importing namespaces" and "adding references". If you open a
new vb project the reference for the functionality of the net-namespace is
already included in the project, since it's hosted in the system assembly.
All you do is adding the reference for the namespace you need at the top of
the source file, like:

imports system.net

that should do it.

Klaus
 
Hi Chris,

In addition to Klaus, when a reference is not build in with the project you
started, you can set it by
Project->Add Reference-> And than a choose between a Net or a Com reference.

Always try to find a Net reference first. Than the rest is as Klaus stated.

Cor
 
Back
Top