What does the global:: stand for in C#? for example what is the difference between
private global::System.Int32 myInt;
and
private int myInt;
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s the “global” namespace – it forces the compiler to look for a name without taking other using directives into consideration. For example, suppose you had:
Basically it’s a way of avoiding naming collisions – you’re most likely to see it in tool-generated code, where the tool doesn’t necessarily know all the other types in the system. It’s rarer to need it in manually-written code.
See “How to: Use the global namespace alias” on MSDN for more details, along with the
::namespace qualifier.