简体   繁体   中英

Using Linq in VS2005 causes error

I am using Visual studio 2005. Why is this line not supported?

using System.Linq;     

Error:

Error 1 Validation (XHTML 1.0 Transitional): Attribute values must be enclosed in quotation marks.

Error 2 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

LINQ is not supported until .NET Framework v3.5, and visual studio 2005 supports .net v2.0 at max.

There are some workaround to use LINQ with .NET 2.0 but you will still need Visual Studio 2008 minimum!

LINQ is part of C#3.0. It is not available in C#2.0 which is the only version VS 2005 supports. So you won't be able to use LINQ without installing at least VS 2008.

If you look LINQ in VS2005 there is a method of getting it to work, but it doesn't support anonymous types taking away some of the power of LINQ.

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