Will linq to sql work in an asp.net 2开发者_如何学运维.0 web application?
Just realized the server doesnt' support asp.net 3.5 (no control over it!)
The server only needs to understand ".net 2.0". When linq was added in .NET 3.0, the CLR was not updated. As long as everything was compiled on a machine that at least had .NET 3.0, it will work fine.
It often looks like a given web server doesn't support 3.0 onwards, because the ASP settings in IIS only give you the option for 1.0.3705, 1.1.4322, and 2.0.50727. But ".NET 3.5" still uses the "2.0.50727" CLR.
If the server is Windows 2000 (or earlier), LINQ will not work because you cannot install DotNet 3.5. However, as Patrick mentioned, don't go by the CLR option you see in IIS as it can look like the machine only has 2.0 even though 3.5 is installed.
I'm guessing the clue is in the LINQ part of that, which is a feature of 3.5, so probably not...
精彩评论