Welcome to Atlanta .NET Regular Guys Sign in | Join | Help

C# global namespace alias

In class we were working with a web service.  Since this was a simple class exercise, all the web service did was sleep for 3 seconds.  When we added the web reference to the web service into our class library (so we could call said web service) we got a declaration that looked like this:

WebService.Service srvc = new global::WebService.Service()

What the heck was that "global::" bit there for?  It was actually in the Intellisense. 

I found this in MSDN2 - http://msdn2.microsoft.com/en-us/library/c3ay4x3d.aspx

Basically you're preventing confusion in the namespaces.  Fair enough.  Cool that Intellisense detected that this keyword was needed, but I'm not sure why my tiny listtle test app needed this since I wasn't using any similar namespace.  The namespace of the project I was using was actually "AdvancedWebParts".  To my knowledge, I wasn't aliasing away my namespace.  I'll have to look back at the code.

Published 20-10-2006 03:31 by Matt Ranlett

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

What do you think?

(required) 
(optional)
(required) 

About Matt Ranlett

One of the two original Atlanta .NET Regular Guys, Matt fills his free time by helping to run several Atlanta area user groups, the Atlanta Code Camps, and works as one of the two INETA co-Vice Presidents of Technology
SkinName:iroha_Blog2
Powered by Community Server, by Telligent Systems