?
Solved

Am I missing an assembly reference?

Posted on 2003-10-26
6
Medium Priority
?
362 Views
Last Modified: 2012-08-13
Hi all. I don't use Visual Studio, only the C# compiler in .NET Framework, on Windows XP. I like to do a small program that uses the XML classes, but I get this error:

vp.cs(3,14): error CS0234: The type or namespace name 'Xml' does not exist in
        the class or namespace 'System' (are you missing an assembly reference?)

And here's the line that is supposed to be in error:

using System.Xml;

Another time, I was acctually able to solve this by adding an explicit reference on the command line, but since I plan to make a lot of small programs like this, I'd rather not have to type this reference every time (and besides, I don't remember how to do it). I guess there's a way to add the reference by using the .NET configuration tools, and that's my question. How?
0
Comment
Question by:liljegren
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:brother7
ID: 9624083
You need to add a reference to System.XML.dll to your project.  If you're using the IDE, you can do this from the Solution Explorer... right-click on the project name and choose "Add Reference...".

It wasn't clear what you're using to program.  Are you using the C# IDE or the C# SDK (where everything is compiled from the commandline)?  I'm assuming you have access to the IDE.
0
 
LVL 4

Expert Comment

by:brother7
ID: 9624176
Just in case you are compiling from the commandline, the way to include a reference is:
   csc Project.cs /reference:System.XML.dll
0
 

Author Comment

by:liljegren
ID: 9624377
I compile from the command-line, and the question is if there's a way to make the reference to System.Xml.dll implicit. I've tried to do this in .NET Configuration 1.1, from the Administrative Tools on the Start menu, but haven't been successful.

I can see that System.Xml.dll is in the GAC, but what's needed more than that? I also use the IO module, and have no problem with that one.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 4

Expert Comment

by:brother7
ID: 9624561
Hmm... I've been looking and I can't find anything.  My guess would be that you have to include the reference in the commandline.
I'd bet that this even happens when you Build using the IDE... the IDE calls csc.exe and passes the references as commandline arguments.  This is just my guess.
I've been looking around to see where the added references info is kept and I think it is in the Solution.suo file which isn't a viewable text file :(
0
 

Author Comment

by:liljegren
ID: 9624660
Thanks. I'll just wait 1 day to see if there might be an answer after all.
0
 
LVL 1

Accepted Solution

by:
LastResort earned 1000 total points
ID: 9627378
Visual studio stores the ref in the propjct file - essentially a makefile.

If you simply create a batch file called 'cscXML.bat' or something that takes the project name as a param you can recreate the functionality you want.

In my opinion you really should look into using sharpdevelop  or web matrix though - your life will become easier.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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