I'm using MVC2 in a mixed webforms project, my Model classes compile fine with optional and named parameters, but my view won't compile when using th开发者_高级运维em. I get:
Error 38 Feature 'named argument' cannot be used because it is not part of the 3.0 C# language specification
Any ideas? Thanks
Your app will need to be configured to run in ASP.NET 4.x rather than 2.x; you might also want (in your web.config):
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v4.0" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
You might get away without this if you pre-compile your views.
精彩评论