It looks as though some namespace hiding is taking place. In VB.NET projects a root namespace exists that is set to your project's name by default. You can check this from Project -> Properties -> Application -> Root namespace.
When a class explicitly specifies a namespace, the root namespace is prefixed to it. For example, let's say your root namespace is RootNs
. Since the DynamicLinq.vb
file specifies a namespace of System.Linq.Dynamic
this is really RootNs.System.Linq.Dynamic
. This hides the regular .NET System
namespace, which is why Visual Studio prompts you to prefix all your namespaces with Global
.
It's worth noting that in C# this concept is different, so I wouldn't expect this issue to come up when someone uses the C# version of DynamicLinq
.
To fix this you have a few options (pick one):
Remove the namespace declaration from DynamicLinq.vb
and remove any full qualifications from objects within that file that use System.Linq.Dynamic
. In other words, System.Linq.Dynamic.Signature
becomes Signature
. To use it elsewhere, add Imports System.Linq.Dynamic
.
Remove the root namespace from Project/Properties/Application by making it blank. By doing so your project will be more like C# and you ought to explicitly specify namespaces in all your classes. To use it elsewhere, add Imports System.Linq.Dynamic
.
Keep the root namespace and just change the namespace of DynamicLinq.vb
. For example, change it to NewNs.Linq.Dynamic
and remove full qualifications from Signature
as before. To use it elsewhere, add Imports RootNs.NewNs.Linq.Dynamic
(notice the RootNs
prefix).