Search code examples
c#vb.nettypesidentifier

Is there something like "global::" for VB.NET?


I am writing a code-generator that will need to output some miniscule portions of VB.NET code, and since this is a code generator that will add user-provider code, I'd like to try to avoid type name conflicts with types or names in the user-provided code.

In C#, I can prefix types with global:: to make sure they're matched from the global type namespace hierarchy, rather than some local name, but is there a similar system for VB.NET?

ie. this:

global::System.String

Solution

  • It's simply the Global keyword:

    Dim n As Global.System.Int32