473,796 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Visual Studio 2005

Hi,

Background: I'm a Java programmer new to c# and Visual Studio.

Problem: When I compile in Visual Studio 2005, the compiler complains,
that it can not find several different namespaces. Examples:

Error 1 The type or namespace name 'Soap' does not exist in the
namespace 'System.Runtime .Serialization. Formatters' (are you missing an
assembly reference?)

Error 2 The type or namespace name 'Drawing' does not exist in the
namespace 'System' (are you missing an assembly reference?)

When I compile from the command prompt there are no problems.
What can be wrong? It seems like Visual Studio is somehow not including
the full API.

Kind regards,
Mads Peter Nymand

Mar 7 '06 #1
5 4038
The VS doens't reference all dlls. How many dlls it references depends on
the type of project you've created (wizard).

If you open the "References " node you'll see all ther referenced assemblies.
Keep in mind that one namespace might be spread over more than one assembly
(even though it is not the common case), so you may have some classes form
the namespace available and some not.

If you in doubt what dll to reference open the MSDN docs (if it goes for a
API type) and in the "About ... type" section you can find out the dll it
comes from.

Why it can compile in command prompt? I guess is because the line compiler
is set up to reference bigger set of dlls.
--
HTH
Stoitcho Goutsev (100)

"Mads Peter Nymand" <ma*******@onca ble.dk> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .
Hi,

Background: I'm a Java programmer new to c# and Visual Studio.

Problem: When I compile in Visual Studio 2005, the compiler complains,
that it can not find several different namespaces. Examples:

Error 1 The type or namespace name 'Soap' does not exist in the
namespace 'System.Runtime .Serialization. Formatters' (are you missing an
assembly reference?)

Error 2 The type or namespace name 'Drawing' does not exist in the
namespace 'System' (are you missing an assembly reference?)

When I compile from the command prompt there are no problems.
What can be wrong? It seems like Visual Studio is somehow not including
the full API.

Kind regards,
Mads Peter Nymand

Mar 7 '06 #2
Thanks a lot for your answer.

Maybe the command prompt compiler is set to include the full C# 2.0
Class Library the same way, that the Java command line compiler is set
to include the full java API class library.

It raises a new question though:

In the command prompt and in the Java IDEs I have used, the whole API
class library of the SDK is included by default. Why isn't it so in VS.
Why do you have such a limited set of references in a C# project in VS?
In the top of a file, you are declaring which namespaces to use. That
makes sense, because you have to define, which namespaces the classes
you are using, are belonging to. In my opinion, it does not make sense,
that you have to define new references (add refernces) at project
level, when you are using namespaces, that is part of the standard C#
library. That's just extra work for no reason. Can anybody give me a
reason why it is so - better stucture? faster execution? - something

Mads Peter

Mar 7 '06 #3
Mads Peter Nymand <ma*******@onca ble.dk> wrote:
Thanks a lot for your answer.

Maybe the command prompt compiler is set to include the full C# 2.0
Class Library the same way, that the Java command line compiler is set
to include the full java API class library.
No - it's set to include a certain set of assemblies. (The difference
is that with Java, all the standard libraries are in one big jar file -
rt.jar.)

If you look in your .NET framework directory, find a file called
csc.rsp. That lists the command-line options which are specified by
default.
It raises a new question though:

In the command prompt and in the Java IDEs I have used, the whole API
class library of the SDK is included by default. Why isn't it so in VS.
Why do you have such a limited set of references in a C# project in VS?
Because Java doesn't really have "references " to start with. You can
put lots of things on a classpath, but it's not really the same thing.
Instead, it's got a huge standard library in one big file. That's not
really great from an organisational perspective.
In the top of a file, you are declaring which namespaces to use. That
makes sense, because you have to define, which namespaces the classes
you are using, are belonging to. In my opinion, it does not make sense,
that you have to define new references (add refernces) at project
level, when you are using namespaces, that is part of the standard C#
library. That's just extra work for no reason. Can anybody give me a
reason why it is so - better stucture? faster execution? - something


Firstly, it's not the standard C# library - it's the standard .NET
framework. C# is just *one* language targetting the .NET framework.

Secondly, namespaces and assemblies are very different things. An
assembly often happens to have types within a namespaces of a similar
name to the assemblies, but they're different to namespaces.

"using" directives just provide shortcuts so you don't need to type the
full name of every type you're using. Assembly references govern which
types are available in the first place.

The .NET framework is better organised than Java in terms of the
standard library being broken up into separate units of functionality.
If you don't need anything to do with System.Messagin g, why make either
the compiler or the runtime load that assembly?

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 7 '06 #4
Thanks a lot for your answer Jon, that cleared things up pretty well.
The .NET framework is better organised than Java in terms of the
standard library being broken up into separate units of functionality.
If you don't need anything to do with System.Messagin g, why make either
the compiler or the runtime load that assembly?


I see your point. Does the Java compiler and runtime have to load the
hole standard library (rt.jar) everytime you compile and run a java
program? If this is the case, it doesn't seem optimal. I always thought
that Java only loaded the packages specified in the import statements.

Mads Peter

Mar 8 '06 #5
Mads Peter Nymand <ma*******@onca ble.dk> wrote:
Thanks a lot for your answer Jon, that cleared things up pretty well.
The .NET framework is better organised than Java in terms of the
standard library being broken up into separate units of functionality.
If you don't need anything to do with System.Messagin g, why make either
the compiler or the runtime load that assembly?


I see your point. Does the Java compiler and runtime have to load the
hole standard library (rt.jar) everytime you compile and run a java
program? If this is the case, it doesn't seem optimal. I always thought
that Java only loaded the packages specified in the import statements.


No - the import statement is only the equivalent of the "using"
directive in C#. It's just a namespace issue.

Now, I don't know the extent to which the Java runtime loads the whole
standard library. I'm sure it loads the index telling it which classes
are available and where within the jar file. My guess is that it then
memory maps the file and accesses the classes it needs as it needs
them.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 8 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2316
by: Shapper | last post by:
Hello, I am starting 2 new projects to deliver in January 2006. I want to create them in Asp.Net 2.0 using Visual Studio 2005. All my clients web sites are Visual Studio 2003 projects in Asp.Net 1.1 / VB.NET. These web sites use Access Databases and NOT Microsoft SQL 2000. In the future I will need to make a few changes now and then to this web sites.
0
3355
by: fiona | last post by:
Innovasys Ltd., a leader in help authoring and documentation tools, today announced the inclusion of a tailored version of the Innovasys HelpStudio help authoring product, HelpStudio Lite, in the Microsoft Visual Studio 2005 Software Development Kit. By providing a full help authoring environment within the Visual Studio 2005 SDK, Innovasys is providing developers building components and products that integrate with Visual Studio 2005 a...
2
3447
by: Progman | last post by:
I have Visual Studio 2005 Standard edition. Is ti the same thing as the Express edition or Standard is more?
12
5915
by: Nathan Sokalski | last post by:
I recently upgraded to from Visual Studio .NET 2003 to Visual Studio .NET 2005. In Visual Studio .NET 2003 when I would select 'Build' it would add a *.dll with the name of the Project to a /bin/ folder in the same directory as the source code. However, in Visual Studio .NET 2005 when I selected 'Publish Web Site' and selected a target location to place it in, it placed the following files in it: All *.aspx files All *.html files
18
9156
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft page "How to: Connect to Data in an Access Database"
8
6274
by: WT | last post by:
Is it normal that Visual Studio sets the PreInit handler for a Page from the OnInit code ? No chance to fire it as OnPreInit is run befor OnInit. ??? CS
3
6064
by: Edwin Smith | last post by:
I have a 2 form project in VS2005 that now hangs whenever I try to do anything with the second form. This seems to have started when I added some SQL tables from a Pervasive v.9 database using the Pervasive ODBC driver. The devenv.exe process hangs and will not respond with about 50% cpu usage and about 100 megs of memory used. I am running it on an Athlon 64 bit dual core with 32 bit Windows XP pro. I have 2 megs of memory so I don't...
1
3602
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in some files and work on it. Let say, I want add new page to web project named websiteOrder.sln, i will open websiteOrder.sln in my local computer, connected to websiteOrder.sln located in Visual Source Safe 6.0(source safe located in another...
1
2506
by: Dr T | last post by:
Hi! I downloaded MS Visual Web Developer 2005 Express Edition, MS .NET Framework SDK v2.0, and MS SQL Server 2005. Subsequently, I bought MS Visual Studio 2005 Professional Edition. 1) Are both the MS Visual Web Developer 2005 Express Edition and the MS Visual Studio 2005 Professional Edition used to develop .ASP applications?
3
1853
by: Rachel Garrett | last post by:
This is driving me mad. I have Visual Studio.NET PRO 2005 installed on my machine at work. I want to write a web service. I find lots of tutorials on how to do this with Visual Studio.NET; some are even Visual Studio.NET 2005. These tutorials all have screenshots of the "Visual Studio Installed Templates" under Visual C#. Here is one example: http://webproject.scottgu.com/CSharp/HelloWorld/Helloworld.aspx
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10244
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.