This one seems to be originated after upgrading from vs2015 to vs2017. The error is
这个似乎是在从vs2015升级到vs2017之后发起的。错误是
Compiler Error Message: The compiler failed with error code -532462766.
编译器错误消息:编译器失败,错误代码为-532462766。
Some notes..
一些笔记..
- It works great on localhost.
- 它在localhost上运行得很好。
- The target framework is 4.5.2
- 目标框架是4.5.2
- I removed and re-installed all the nuget packages
- 我删除并重新安装了所有nuget包
Whie tracing i have
跟踪我有什么
ModuleName AspNetInitializationExceptionModule
Notification BEGIN_REQUEST
HttpStatus 500
HttpReason Internal Server Error
HttpSubStatus 0
ErrorCode The operation completed successfully.
And the full message is such
完整的信息是这样的
C:\Windows\SysWOW64\inetsrv>C:\Inetpub\vhosts\xxx\example.com\bin\roslyn\csc.exe /t:library /utf8output /nostdlib+
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\6c18e943\c9225320_3eb1d201\Antlr3.Runtime.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\e4a088a1\d00a7551_3eb1d201\Microsoft.AI.Agent.Intercept.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\cb16e378\ec642953_3eb1d201\Microsoft.AI.WindowsServer.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\3bcba04c\243c6d4f_3eb1d201\Microsoft.AI.DependencyCollector.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\44aabbe1\43688156_3eb1d201\Microsoft.AspNet.Identity.EntityFramework.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\c0b08566\baa93959_3eb1d201\Microsoft.Owin.Security.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\4ed695a8\d6318e55_3eb1d201\Microsoft.AspNet.Identity.Core.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Routing\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Routing.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\e1faf943\7dc91593_3eb1d201\System.Web.Helpers.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\d06f7c29\f00a7a59_3eb1d201\Microsoft.Owin.Security.Facebook.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\72fa63a2\3e710999_3eb1d201\System.Web.Optimization.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\69efa965\80b6a15a_3eb1d201\Microsoft.Owin.Security.OAuth.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\b5b18ada\bafef257_3eb1d201\Microsoft.Owin.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\57f6acbf\bf5aa39d_3eb1d201\System.Web.WebPages.Razor.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\b18fe0f8\d27b8252_3eb1d201\Microsoft.AI.PerfCounterCollector.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\58d0af31\0bf4d912_7cb1d201\example.com.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\df149659\936bd959_3eb1d201\Microsoft.Owin.Security.Google.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\637d4f4f\aff16432_3eb1d201\EntityFramework.SqlServer.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\c43f3530\12875164_3eb1d201\PayPal.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.WebRequest\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.WebRequest.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\8137658b\df0ddf58_3eb1d201\Microsoft.Owin.Security.Cookies.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\cc389662\6acf8b55_3eb1d201\Microsoft.ApplicationInsights.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\97f593a8\fcd60f60_3eb1d201\Newtonsoft.Json.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\822a23c0\69b8113a_3eb1d201\log4net.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Abstractions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Abstractions.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\04f65f20\4100a85b_3eb1d201\Owin.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\e0e14e11\24f0e756_3eb1d201\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\1b86b20b\543f309b_3eb1d201\System.Web.Razor.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\53a4612a\e06ea1ad_3eb1d201\WebGrease.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Web.Infrastructure\v4.0_1.0.0.0__31bf3856ad364e35\Microsoft.Web.Infrastructure.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\4e98cd9b\ec546e56_3eb1d201\Microsoft.AspNet.Identity.Owin.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\06f3878a\e6344c99_3eb1d201\System.Web.Mvc.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\a4d4a537\d27b8252_3eb1d201\Microsoft.AI.ServerTelemetryChannel.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\00ff694d\c557ce4d_3eb1d201\EntityFramework.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\2de5dee5\150fa158_3eb1d201\Microsoft.Owin.Host.SystemWeb.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\a265bb71\f207155a_3eb1d201\Microsoft.Owin.Security.MicrosoftAccount.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\00534da5\ba17e25a_3eb1d201\Microsoft.Owin.Security.Twitter.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\d9fef609\fe73809c_3eb1d201\System.Web.WebPages.Deployment.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\db1905dd\01e2289e_3eb1d201\System.Web.WebPages.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\assembly\dl3\3cda5a04\99511653_3eb1d201\Microsoft.AI.Web.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.dll" /out:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\App_global.asax.dwcg-nlu.dll"
/D:DEBUG /debug+ /optimize- /warnaserror- /w:4 /nowarn:1659;1699;1701;612;618 /langversion:6 /nowarn:1659;1699;1701 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\App_global.asax.dwcg-nlu.0.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\57e80104\20ff5a91\App_global.asax.dwcg-nlu.1.cs"
4 个解决方案
#1
37
And the winner is ASP.NET Dynamic Compilation
获胜者是ASP.NET动态编译
These lines in web.config where the cause. I only wish i knew how they got there. Was it a nu-get package or the VS2017 compilation?
这些行在web.config中的原因所在。我只希望我知道他们是如何到达那里的。它是nu-get包还是VS2017编译?
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /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.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
</compilers>
</system.codedom>
#2
20
Deleting my bin folder fixed this for me, it occurred after switching branches which had different nuget packages in packages.config
删除我的bin文件夹为我修复了这个问题,它是在切换了packages.config中具有不同nuget包的分支之后发生的
#3
6
If you remove this part, this may work. But it seems, that this can break your view-compilation. In my case, the null-conditional operator wont work. Solution was to update the .NET-Framework to 4.6.2 in my target system (dev-environment was on the newest, so I hadnt had this issue there).
如果您删除此部分,这可能会有效。但似乎这可能会打破你的视图编译。在我的例子中,空条件运算符不起作用。解决方案是在我的目标系统中将.NET-Framework更新到4.6.2(dev-environment是最新的,所以我没有遇到过这个问题)。
#4
1
Updating to .NET-Framework to 4.6.2 on target server fixed this for me.
在目标服务器上更新到.NET-Framework到4.6.2为我修复了这个问题。
#1
37
And the winner is ASP.NET Dynamic Compilation
获胜者是ASP.NET动态编译
These lines in web.config where the cause. I only wish i knew how they got there. Was it a nu-get package or the VS2017 compilation?
这些行在web.config中的原因所在。我只希望我知道他们是如何到达那里的。它是nu-get包还是VS2017编译?
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /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.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
</compilers>
</system.codedom>
#2
20
Deleting my bin folder fixed this for me, it occurred after switching branches which had different nuget packages in packages.config
删除我的bin文件夹为我修复了这个问题,它是在切换了packages.config中具有不同nuget包的分支之后发生的
#3
6
If you remove this part, this may work. But it seems, that this can break your view-compilation. In my case, the null-conditional operator wont work. Solution was to update the .NET-Framework to 4.6.2 in my target system (dev-environment was on the newest, so I hadnt had this issue there).
如果您删除此部分,这可能会有效。但似乎这可能会打破你的视图编译。在我的例子中,空条件运算符不起作用。解决方案是在我的目标系统中将.NET-Framework更新到4.6.2(dev-environment是最新的,所以我没有遇到过这个问题)。
#4
1
Updating to .NET-Framework to 4.6.2 on target server fixed this for me.
在目标服务器上更新到.NET-Framework到4.6.2为我修复了这个问题。