Compiler Error Message: The compiler failed with error code -532462766

ⅰ亾dé卋堺 提交于 2020-05-09 18:27:14

问题


This one seems to be originated after upgrading from vs2015 to vs2017. The error is

Compiler Error Message: The compiler failed with error code -532462766.

Some notes..

  • It works great on localhost.
  • The target framework is 4.5.2
  • I removed and re-installed all the nuget packages

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"

回答1:


And the winner is ASP.NET Dynamic Compilation

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?

<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=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>



回答2:


Deleting my bin folder fixed this for me, it occurred after switching branches which had different nuget packages in packages.config




回答3:


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).




回答4:


Updating to .NET-Framework to 4.6.2 on target server fixed this for me.




回答5:


In my case, i'd accidentally configured a new project to use the current version 2.x.x of Microsoft.Net.Compilers where other projects in the solution were using version 1.0.0.




回答6:


I had this problem when introducing the Roslyn compiler to a Sharepoint project.

The first problem was Could not find a part of the path ... bin\roslyn\csc.exe, which was solved by copying csc.exe to the bin folder in the virtual directory for the site.

After that I got the problem with the error code -532462766, which was because it was missing the dll's specified in the csc.exe.config, so make sure to copy them as well from where you are copying the csc.exe, along with the rest of the files you find there.



来源:https://stackoverflow.com/questions/43328087/compiler-error-message-the-compiler-failed-with-error-code-532462766

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!