[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using System.Net

Posted on 2012-09-15
8
Medium Priority
?
314 Views
Last Modified: 2012-09-16
Using System.Net isn't working...

C# VS 2010

I get a "are you missing an assembly reference" error.

What am I missing?
0
Comment
Question by:classnet
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 total points
ID: 38402553
Could you give us the exact error message that you are receiving. There is nothing called System.net. There are the system namespace and system.dll, but it is the first time I see System.Net.

A message like this one might appear however if the reference to the System.dll was removed from the project. If this is so, go to the References tab of the project's properties (Project menu) and click the Add button to add a reference to System.dll. Do the same for any assembly for which you would get that message.
0
 
LVL 5

Expert Comment

by:sameer_goyal
ID: 38402583
Well, there sure is System.Net namespace. It is primarily used when working with windows/desktop applications.

The error you mention can only occur if the reference to System.dll is somehow missing from your project.

Try adding the reference to System.dll and try again. You should be all set.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38402598
It would be better to know the specific class you are attempting to use. The System.Net namespace actually occurs within multiple assemblies.
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
LVL 5

Expert Comment

by:sameer_goyal
ID: 38402643
kaufmed:

I don't agree to 'The System.Net namespace actually occurs within multiple assemblies.'

If what you say is correct, then it defeats the whole purpose of having namespaces in .net

when you say, System.Net, that can be only 1 and it is only available under System.dll assembly.

Can you provide names of some other assemblies where System.Net is present?
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38402654
If what you say is correct, then it defeats the whole purpose of having namespaces in .net
It assuredly does not. Worst case:  it means you have to fully-qualify your declarations.

Per your request, please see the decompiled versions of System.dll and System.Net.dll in the attached screenshot.

Screenshot
0
 
LVL 40
ID: 38402742
I stand corrected, there is indeed a System.Net namespace. But from what I see, it contains the basic classes for web and network communications (cookies, http, upload and download).

Since my work is in Windows applications and databases, I never had use for that namespace and never encoutered it. I was on the impression that it had been confused with the System namespace that is at the root of most of the framework.

Sorry if my comment could have caused confusion.

As for the discussion about a namespace that exists along many assemblies, kaufmed is right. Although it is not common, it happens for a few namespaces. The purpose of a namespace is not to reference a dll, it is to have a way to more easily find a class and to differentiate between 2 classes with the same name.
0
 

Author Closing Comment

by:classnet
ID: 38403054
I was missing the ref to System.dll

Thank you
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38403145
The purpose of a namespace is not to reference a dll, it is to have a way to more easily find a class and to differentiate between 2 classes with the same name.
I'd probably phrase that as, "the purpose of namespaces is to avoid naming conflicts. Two different classes can have the same name so long as each exists in its own namespace."

= )
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 23 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question