DynamicQuery is a sample project that allows 'Dynamic' LINQ strings to be executed at run-time. I want to use this in a project of mine.
I've created a new Window Forms Application in VB.Net; and add the existing item - 'Dynamic.vb' (taken from the DynamicQuery example).
Once I do that, code that was previous fine, is now marked as incorrect by the compiler.
'Globalization' is not a member of 'System'. Type 'System.Windows.Forms.Form' is not defined.
I'm kind of at a loss for what is going on. If I remove Dynamic.vb from my project, the errors disappear.
Dynamic.vb begins with a Namespace declaration, I'm guessing that is related, but I don't understand what is going on. Can someone help?
EDIT The Dynamic.vb starts with 'Namespace System.Linq.Dynamic' but once I add it to my project when I do 'System.' my intellisense only shows 'System.Linq' - everything else is gone开发者_如何转开发.
Also - all of the references in the example project are included in my project.
Also - if I change the Namespace line in the Dynamic.vb file to be 'MySystem.Linq.Dynamic' - everything works.
Is this just a bug in Visual Studio? Or am I missing something?
In VB.NET some projects, if you check your project properties, you may have default namespace this could be hiding it. I think this is for ASP.NET VB.NET but not sure if it applies in your case. You can see if this is being used under solution/project properties.
精彩评论