Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo

  Adding a reference in VS.NET (Thursday, September 02, 2004)




Found the following interesting discussion in the Newsgroups:

Adding a reference
by:cwertman@yahoo.com (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


 Reply:
by:Klaus Löffelmann

 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


 Reply:
by:Cor Ligthert

 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








 
Previous Posts
    - Converting String Value to a Formula for calculati...
    - Microsoft Office Document Image Writer & Vb.Net
    - AddRange method for CheckedListBox
    - Any way to extract certain bytes from the remote f...
    - Date format problem with vb.net
    - Dynamic Expression Evaluation
    - Finding the Printable area
    - How to add a dimension to an array in VB.NET
    - How to access a Specific Mailbox on Exchange
    - DataGrids and obtaining information from them

Archives
    - 08/01/2004 - 08/08/2004
    - 08/08/2004 - 08/15/2004
    - 08/15/2004 - 08/22/2004
    - 08/22/2004 - 08/29/2004
    - 08/29/2004 - 09/05/2004
    - 09/05/2004 - 09/12/2004
    - 09/12/2004 - 09/19/2004
    - 09/19/2004 - 09/26/2004
    - 09/26/2004 - 10/03/2004
    - 10/03/2004 - 10/10/2004
    - 01/02/2005 - 01/09/2005
    - 01/09/2005 - 01/16/2005
    - 01/30/2005 - 02/06/2005
    - 01/01/2006 - 01/08/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland