473,396 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

global:: ?

Have I been missing a keyword in C# for the past few years, is it new
to beta 2.0, or is it a bug in vs.net 2005 beta1? You type in global::
and get a load of namespaces? My first guess would be that it's a bug
with the intellisense, using c++ intellisense by accident..

For example
throw new global::System.NotImplementedException();

Any ideas?

Nov 16 '05 #1
2 4081
Hi,

No, it isn't a bug. It's a global namespace qualifier which indicates the
compiler to start the search at global scope. Example:

namespace Examples
{
class MyClass
{
public void MyMethod ()
{
::MyClass obj = new ::MyClass ();
obj.MyMethod ();
}
}
}

public class MyClass
{
public void MyMethod ()
{
Trace.WriteLine ("Hello!");
}
}

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
<sl********@gmail.com> je napisal v sporocilo
news:11**********************@c13g2000cwb.googlegr oups.com ...
Have I been missing a keyword in C# for the past few years, is it new
to beta 2.0, or is it a bug in vs.net 2005 beta1? You type in global::
and get a load of namespaces? My first guess would be that it's a bug
with the intellisense, using c++ intellisense by accident..

For example
throw new global::System.NotImplementedException();

Any ideas?

Nov 16 '05 #2
Hi,

It is a new feature in C# 2.0 - namespace alias.
See
http://download.microsoft.com/downlo...cationVer2.doc
chapter 25.3 Namespace alias qualifiers

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

<sl********@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Have I been missing a keyword in C# for the past few years, is it new
to beta 2.0, or is it a bug in vs.net 2005 beta1? You type in global::
and get a load of namespaces? My first guess would be that it's a bug
with the intellisense, using c++ intellisense by accident..

For example
throw new global::System.NotImplementedException();

Any ideas?

Nov 16 '05 #3

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

Similar topics

8
by: David Hitillambeau | last post by:
Hi guys, As I am new to Python, i was wondering how to declare and use global variables. Suppose i have the following structure in the same module (same file): def foo: <instructions>...
1
by: Andr? Roberge | last post by:
I have the following two files: #--testexec.py-- def exec_code(co): try: exec co except: print "error" #-- test.py--
7
by: Lyn | last post by:
Hi and Season's Greetings to all. I have a question regarding the use of a qualifier word "Global". I cannot find any reference to this in Access help, nor in books or on the Internet. "Global"...
10
by: David P. Donahue | last post by:
When I wrote websites in VB .NET, I would often put functions in Global for all the pages to call. Now, in C#, doing so results in "references to non-static objects" and whatnot. I realize what...
22
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to...
9
by: CDMAPoster | last post by:
About a year ago there was a thread about the use of global variables in A97: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/fedc837a5aeb6157 Best Practices by Kang...
3
by: User1014 | last post by:
A global variable is really just a property of the "Global Object", so what does that make a function defined in the global context? A method of the Global Object? ...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.