Compilation Error - The compiler failed with error code 1 - asp.net error after publishing

人走茶凉 提交于 2019-12-12 02:44:22

问题


After publishing my asp.net MVC 5 website to the hosting environment, I got the following error message

Compilation Error - The compiler failed with error code 1

Nothing else besides the compiler-call itself is shown.


回答1:


In my case, the MVC-templates added the following section in the web.config file:

<system.codedom>
<compilers>
  <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.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.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>

After removing them, everything worked as expected.



来源:https://stackoverflow.com/questions/33316738/compilation-error-the-compiler-failed-with-error-code-1-asp-net-error-after

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