开发者

Changing framework version of Asp.Net site from web.config

I have a framework 2.0 asp.net website, I want to change it's framework version to 3.5. Is it possible to do this manually from web.config file? I don't want to change from visual studio property pages. I need to change from web.config, what should 开发者_如何学GoI do?


There's isn't anything special that you need to do. If you don't use any assembly from .NET 3.5, then do nothing as both framework versions use the same CLR 2.0 so there should be absolutely no difference at runtime. If you want to use some 3.5 assemblies (such as System.Core), just reference them in your project and deploy.

One thing that you might want to change is the C# compiler version used for aspx and ascx pages in case you are doing some LINQ stuff, anonymous objects, collection initializers, ... in these pages (which by the way you should try to avoid because this belongs to code behind but anyway):

<system.codedom>
    <compilers>
        <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <providerOption name="CompilerVersion" value="v3.5"/>
            <providerOption name="WarnAsError" value="false"/>
        </compiler>
    </compilers>
</system.codedom>


Why not change the setting using IIS Manager?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜