473,614 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which namespaces are automatically "used" by .net platform?

As you might know that "java.lang" package are automatically imported by the
java compiler so that one don't need to write the import statement of that
package in the source code. Are there any packages in .net are automatically
"used" when your are writing a .net application? I am told that Visual Studio
..net automatically include different packages depending on the kind of
applications you are creating. is this true? Will the compilier include any
"default" packages, e.g. "System"?
Jul 21 '05 #1
4 1478
Sparks,
I am told that Visual Studio
.net automatically include different packages depending on the kind of
applications you are creating. is this true? Will the compilier include
any
"default" packages, e.g. "System"?


This is simple to answer

Yes

I hope this helps,

Cor
Jul 21 '05 #2
Thanks for your reply Cor, but I still have no idear if any packages are
automatically included. Do you mean VS Studio .net automatically include some
packages depending on the type of application you are creating? Or the
compilier will include some "default" packages? Or did you mean both?

Could you also pls kindly list what packages are automatically included in
by VS Studio.net or/and the compilier?

Thanks very much!

"Cor Ligthert" wrote:
Sparks,
I am told that Visual Studio
.net automatically include different packages depending on the kind of
applications you are creating. is this true? Will the compilier include
any
"default" packages, e.g. "System"?


This is simple to answer

Yes

I hope this helps,

Cor

Jul 21 '05 #3
sparks <sp****@discuss ions.microsoft. com> wrote:
As you might know that "java.lang" package are automatically imported by the
java compiler so that one don't need to write the import statement of that
package in the source code. Are there any packages in .net are automatically
"used" when your are writing a .net application? I am told that Visual Studio
.net automatically include different packages depending on the kind of
applications you are creating. is this true? Will the compilier include any
"default" packages, e.g. "System"?


When VS.NET creates a project, it adds various references
automatically, depending on the type of project. You can find that out
by expanding the list of references.

However, C# doesn't include any namespaces by default other than the
namespace of the class you're writing and all "parent" namespaces. (So
if you're writing a class in Foo.Bar, then Foo.Bar, Foo and the unnamed
namespace are all automatically included.)

This is language-specific though - other languages may include
namespaces automatically.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4
Sparks,

When you open by instance a VBNet winforms project than it set automaticly
the resources that it normally needs for that. As well set it the most used
imports (namespaces) in a kind of property file (with C# it sets that in top
of the program files).

When you open an VBNet webapplication, than it will set automaticly other
resources and an other import (However the Microsoft.Visua lBasic namespace
is forever included in VBNet while it is never in C#, although you can use
that in the same way as every other namespace in C#)

Than everything is included to make a kind of standard winforms or webforms
application. Do you need more librarys, than you can add those using the
Project->resources. You can than choose to declare the full namespace in
your code or to set an Using (with C) or a Import with VBNet (Acts completly
the same however it needs in C# a ";" at the end).

You can manage a lot of behaviour using the properties from VSNet.

I hope this helps,

Cor
Jul 21 '05 #5

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

Similar topics

4
1993
by: Mark Erikson | last post by:
I'm currently writing an HTML editor for the PocketPC, and one of my Tag class's properties is DefaultAttributes. The idea behind this is that some tags are almost always used with certain attributes, ie <a href="">, so I'd like to make sure those attributes are included when I insert the tag. Since I actually don't write that much HTML myself, I was hoping to get some feedback as to which tag/attribute combinations are used particularly...
9
1966
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual Basic .Net application. I have researched MSDN for help and found the example article 321900 (see below) and set up a test and everything works fine when I use SQL Server 2000 but when I modify the code and use data from Access 2000 using an...
4
2514
by: J. Campbell | last post by:
From reading this forum, it is my understanding that C++ doesn't require the compiler to keep code that does not manifest itself in any way to the user. For example, in the following: { for(int i = 0; i < 10; ++i){ std::cout << i << std::endl; for(int j = 0; j < 0x7fffffff; ++j){} } }
40
7854
by: Dave Hansen | last post by:
Please note crosspost. Often when writing code requiring function pointers, it is necessary to write functions that ignore their formal parameters. For example, a state machine function might take a status input, but a certain error-handling state might ignore it: typedef void (*State_Fn)(uint8_t); void error_state(uint8_t status)
4
325
by: sparks | last post by:
As you might know that "java.lang" package are automatically imported by the java compiler so that one don't need to write the import statement of that package in the source code. Are there any packages in .net are automatically "used" when your are writing a .net application? I am told that Visual Studio ..net automatically include different packages depending on the kind of applications you are creating. is this true? Will the compilier...
4
3050
by: escristian | last post by:
Hello. I'm trying to create an Image so I use something like this: Image newImage = Image.FromFile(filename); Now when it's a bmp file and certain .gif files it gives me an exception that says: "Invalid parameter used". The gif an bmp files are valid image files, I can open them in any graphics software and windows can do the preview.
94
30264
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock Statement (C# Reference) statement to serialize access. " But when is it better to use "volatile" instead of "lock" ?
0
8627
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...
1
8279
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8433
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7093
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
5540
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
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1425
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.