I added a reference to the System.Core assembly. The web.config now has:
<add assembly='System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089'/>
The IIS is set to use ASP.NET version 2.0.50727
Though intellisense shows the extension methods, the compiler does not understand the linq syntax. I can use Linq in other class libraries in the solution.
How do I fix this?
**EDIT: I have the following already in the web.config
<system.web> <compilation <assemblies> <!-- references here //--> </assemblies> <compilers> <compiler language='c#' type='Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089' extension='.cs' compilerOptions='/d:DEBUG;TRACE' /> </compilers> </compilation> </system.web>
I don’t have the <system.codedom> node. This is a project that has been migrated from 1.x to 2.x to 3.5. Do I remove the <compilers> from the and add it to <system.codedom> ?
Please note that I want to do minimal change necessary to get this to work as this is a large scale Enterprise project (and I dont want to mess with the web.config too much) **
Just adding the assembly creates a reference, but you have to specify which version of the compiler you are using.
You need to update the
<system.codedom>element in the web.config file:The important part you have to make sure is in the
<compiler>element is this child element:This makes sure that you are using v3.5 of the C# compiler.
The
<system.codedom>element is a child of the<configuration>element, as per the documentation:http://msdn.microsoft.com/en-us/library/k6bttwes.aspx