.net 编译器错误消息:编译器失败,错误代码为 -532462766
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43328087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Compiler Error Message: The compiler failed with error code -532462766
提问by OrElse
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.
- The target framework is 4.5.2
- I removed and re-installed all the nuget packages
- 它在本地主机上运行良好。
- 目标框架是4.5.2
- 我删除并重新安装了所有 nuget 软件包
Whie tracing i have
Whie追踪我有
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\roote80104ff5a91\assembly\dl3c18e943\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\roote80104ff5a91\assembly\dl3\e4a088a1\d00a7551_3eb1d201\Microsoft.AI.Agent.Intercept.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\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\roote80104ff5a91\assembly\dl3bcba04c3c6d4f_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\roote80104ff5a91\assembly\dl3aabbe1688156_3eb1d201\Microsoft.AspNet.Identity.EntityFramework.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\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\roote80104ff5a91\assembly\dl3ed695a8\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\roote80104ff5a91\assembly\dl3\e1faf943dc91593_3eb1d201\System.Web.Helpers.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\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\roote80104ff5a91\assembly\dl3fa63a2e710999_3eb1d201\System.Web.Optimization.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3efa965b6a15a_3eb1d201\Microsoft.Owin.Security.OAuth.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\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\roote80104ff5a91\assembly\dl3f6acbf\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\roote80104ff5a91\assembly\dl3\b18fe0f8\d27b8252_3eb1d201\Microsoft.AI.PerfCounterCollector.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3d0af31<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>
bf4d912_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\roote80104ff5a91\assembly\dl3\df1496596bd959_3eb1d201\Microsoft.Owin.Security.Google.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl37d4f4f\aff16432_3eb1d201\EntityFramework.SqlServer.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3\c43f3530875164_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\roote80104ff5a91\assembly\dl337658b\df0ddf58_3eb1d201\Microsoft.Owin.Security.Cookies.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3\cc389662acf8b55_3eb1d201\Microsoft.ApplicationInsights.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3f593a8\fcd60f60_3eb1d201\Newtonsoft.Json.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl32a23c0b8113a_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\roote80104ff5a91\assembly\dl3f65f2000a85b_3eb1d201\Owin.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3\e0e14e11f0e756_3eb1d201\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3b86b20b3f309b_3eb1d201\System.Web.Razor.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3a4612a\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\roote80104ff5a91\assembly\dl3e98cd9b\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\roote80104ff5a91\assembly\dl3f3878a\e6344c99_3eb1d201\System.Web.Mvc.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\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\roote80104ff5a91\assembly\dl3##代码##ff694d\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\roote80104ff5a91\assembly\dl3de5dee50fa158_3eb1d201\Microsoft.Owin.Host.SystemWeb.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3\a265bb71\f207155a_3eb1d201\Microsoft.Owin.Security.MicrosoftAccount.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3##代码##534da5\ba17e25a_3eb1d201\Microsoft.Owin.Security.Twitter.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3\d9fef609\fe73809c_3eb1d201\System.Web.WebPages.Deployment.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3\db1905dde2289e_3eb1d201\System.Web.WebPages.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\assembly\dl3cda5a04511653_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\roote80104ff5a91\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\roote80104ff5a91\App_global.asax.dwcg-nlu.0.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\roote80104ff5a91\App_global.asax.dwcg-nlu.1.cs"
回答by OrElse
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 编译?
##代码##回答by Rich
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 包的分支之后
回答by FaustsErbe
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(开发环境是最新的,所以我没有在那里遇到这个问题)。
回答by tobydodds
Updating to .NET-Framework to 4.6.2 on target server fixed this for me.
在目标服务器上更新到 .NET-Framework 到 4.6.2 为我解决了这个问题。
回答by Sam Jones
In my case, i'd accidentally configured a new project to use the current version 2.x.xof Microsoft.Net.Compilerswhere other projects in the solution were using version 1.0.0.
就我而言,我会不小心配置一个新的项目使用当前版本2.x.x的Microsoft.Net.Compilers其中溶液中的其它项目使用的版本1.0.0。
回答by Alex
I had this problem when introducing the Roslyn compiler to a Sharepoint project.
我在将 Roslyn 编译器引入 Sharepoint 项目时遇到了这个问题。
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.
第一个问题是找不到路径的一部分... bin\roslyn\csc.exe,这是通过将 csc.exe 复制到站点虚拟目录中的 bin 文件夹来解决的。
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.
在那之后,我遇到了错误代码 -532462766 的问题,这是因为它缺少 csc.exe.config 中指定的 dll,因此请确保也从复制 csc.exe 的位置复制它们,以及您在那里找到的其余文件。

