开发者

How can I use dynamic LINQ in my asp.net project?

How can I use dynamic LINQ in Visual Studio 2008?

I'm 开发者_开发技巧trying to use

using System.linq.Dynamic 

but there is no intellisense. How can I use it?


Well, I'll first say that dynamic LINQ is usually overkill, but sometimes useful. But you should just be able to reference the dll and away you go. If no intellisense is appearing, but it compiles, then check where (physically) the dynamic linq dll is located. Ensure the "foo.dll.xml" file is located next to "foo.dll" (where "foo" is the assembly - perhaps System.Linq.Dynamic ?). This is key for intellisense when using assembly references.


You should find the answer in here:

How do I build up LINQ dynamically


I was also struggling with this and this is how I got it work:

  1. Place the Dynamic.cs file in the App_Code folder of your application (not sure this is absolutely necessary but I'd it anyway)
  2. Once there right click this file (Dynamic.cs) in your solution explorer and in it's properties window change the build action to COMPILE! (this is crucial)
  3. Now you need to add using System.Linq.Dynamic; where you intend to use it

thanks to this guy

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜