[英]Downgrade Asp.Net application to .Net framework 4.5.2 from 4.6.1
我想將當前針對.net Framework 4.6.1的應用程序之一降級到較低的版本4.5.2。 此應用程序有許多相關項目,並且隨Nuget一起安裝了幾個庫。 以下是我執行的降級步驟。
運行以下命令,以從Nuget卸載並重新安裝所有從屬軟件包。
更新包-重新安裝
不需要執行此步驟,但可以肯定的是,我刪除了packages文件夾,然后在構建解決方案時允許Visual Studio重新下載它。
經過上述所有步驟,當我發布站點或使用TFS創建版本並將其部署到IIS並運行它時,出現以下錯誤。
.NET Runtime version : 4.0.30319.36373 - This application could not be started.This application requires one of the following versions of the .NET Framework:
.NETFramework,Version=v4.6
Do you want to install this .NET Framework version now?
最終對我來說問題是因為在4.6版本的web.config中添加了system.codedom編譯器部分,當版本更改為4.5.2時,此部分不起作用。 刪除該部分后,它開始為我工作
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
</compilers>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.