VB Dynamic Query Library woes

According to my searches on the internet, not many people were having trouble trying to use the Linq Dynamic Query library inside a class library project.

The problem was that with my Asp.Net web project, I wanted to have my middle-tier code inside a class library which would then be referenced by the website (and another planned website later on). This class library would contain (amongst other things) my Linq data context and the Dynamic Query library. However, whenever I added the Dynamic Query library to the project the compiler would start complaining about missing objects.

After much tearing my hair out and research I still couldn't find the problem so I left it to work on something else. A similar issue arised when I was working on a completely unrelated piece of code, so it wasn't just attributed to the Linq library in my original problem. The real issue?

VB.Net class library namespaces. When you create a VB.Net class library project, you can specify a default namespace for everything in that library, and so when you are creating something inside a sub-namespace you leave off the default namespace which is already set on the project.

The dynamic library is implemented inside the namespace System.Linq.Dynamic, and so when I added it to my class library project the namespace it was in was actually MyNamespace.System.Linq.Dynamic. This meant that the System namespace now clashed with MyNamespace.System, and the data context which imports the System namespace, and was in MyNamespace, was importing the wrong one. Obviously, this was also happening to anything which imports the System or any sub-namespace of System. Which means essentially that the hellmouth opened and the world was in chaos. This issue doesn't arise in a normal web project, since you don't define a default namespace for classes. I haven't tried this, but I also assume the issue won't arise in a C# class library project since, while you can specify a default namespace for your classes, the compiler doesn't anonymously prepend your default namespace name onto the one you've explicitely set in the code file.

The solution is simple - dive into the code file for the Linq Dynamic Query library and remove the namespace declaration.