2017-04-10 7 views
16

從VS2015升級到vs2017之後,這個問題似乎就出現了。 該錯誤是編譯器錯誤消息:編譯器失敗,顯示錯誤代碼-532462766

編譯器錯誤消息:錯誤代碼 -532462766失敗的編譯器。

的一些注意事項..

  • 它在本地主機上的偉大工程。
  • 目標框架是4.5.2
  • 我刪除並重新安裝了所有的Nu​​Get包

WHIE跟蹤我有

ModuleName  AspNetInitializationExceptionModule 
Notification BEGIN_REQUEST 
HttpStatus  500 
HttpReason  Internal Server Error 
HttpSubStatus 0 
ErrorCode  The operation completed successfully. 

而完整的消息是這樣的

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" 

回答

27

而獲勝者是ASP.NET Dynamic 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=\&quot;Web\&quot; /optionInfer+" /> 
    </compilers> 
    </system.codedom> 
+3

我猜VS2017有不同的NuGet包後發生;我以前從未遇到過這個問題。感謝你的回答! – mmizzle9

+2

只是爲了讓別人清楚......解決辦法是刪除這裏顯示的六條線。 – Matt

+0

安裝Microsoft.CodeDom.Providers.DotNetCompilerPlatform NuGet包後出現這些行。 –

5

如果刪除此零件,可能會有效。但看起來,這可能會打破你的視圖編輯。在我的情況下,空條件運算符不會工作。 解決方案是在我的目標系統中將.NET-Framework更新到4.6.2(開發環境是最新的,所以我沒有遇到這個問題)。

+1

這也打破了「nameof」:(4.6.2沒有安裝在我的目標服務器上,但要試一試4.6.1 – Tom

9

刪除我的bin文件夾固定的這對我來說,它的開關分支這packages.config

+0

我在部署web api後遇到同樣的問題,而As @Rich說刪除bin文件夾固定了所有。 – katmanco

+0

這應該是被接受的答案。它可以修復問題而不刪除任何功能。 –