简体   繁体   中英

VS2005 and LINQ

如果安装了.NEt 3.5,可以在VS2005中使用LINQ吗?

The thing to remember is that at it's core Visual Studio, like any IDE, is a glorified text editor with an integrated debugger, and maybe a few other features as well. You could certainly use Visual Studio 2005 to input the code text of your linq program and then use the .Net 3.5 command line compiler to build it. You might even be able to find or write an add-in to automate the build process.

That means the technically correct answer to your question is, "Yes."

However, you won't get any extra IDE support:

  • Incorrect/broken intellisense.
  • Incorrect/broken syntax highlighting
  • Inability to work with .Net 3.5+ solution files.
  • No debugger support

The result is that you would probably be better served if I had simply said, "No."

If you already have 2005 but not 2008, you have a few options:

  • Get the 2008 Express Edition
  • Use a third-party tool like #Develop
  • Buy a 2008 full edition

There is no direct compiler support for LINQ in VS 2005.

You can still use the LINQ namespace and methods, however, it is not as elegant as using it in VS 2008.

See this article for details.

Vs2005 and C# do not directly support Extension Methods, Lambda Expression, Anonymous Types or Expression Trees which are key enabling features of LINQ. Some of the early LINQ betas did work with VS2005 and C# but none of the release products.

Likely the same for VB but I can't directly comment on VB other than I am about 99.99% sure you can't.

Simple answer is no. LINQ relies on language features (such as extension methods) that VS2005 does not support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM