IIS编译错误-2146232576 AspNetInitializationExceptionModule [英] IIS Compilation Error -2146232576 AspNetInitializationExceptionModule

查看:104
本文介绍了IIS编译错误-2146232576 AspNetInitializationExceptionModule的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当简单的C#WebAPI2项目,该项目在本地运行,但是在发布到远程计算机(Windows Server 2012 R2 Standard)上的IIS之后,网页显示以下内容(将customErrors设置为"Off"之后):

I have a fairly simple C# WebAPI2 project that runs locally but after publishing to IIS on a remote machine (Windows Server 2012 R2 Standard) the web page displays the following (after setting customErrors to "Off"):

"/"应用程序中的服务器错误. 编译错误 说明:在编译所需的资源期间发生错误 服务此请求.请查看以下特定的错误详细信息,并适当地修改您的源代码. 编译器错误消息:编译器失败,错误代码-2146232576.

Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: The compiler failed with error code -2146232576.

如果我抓取详细的编译器输出,然后在IIS服务器上运行它, 智能屏幕错误消息说:

If I grab the detailed compiler output and run it on the IIS server, I get a smartscreen error message saying:

此应用无法在您的PC上运行.要为您的PC查找版本,请与软件发行商联系.

This app can't run on your PC. To find a version for your PC, check with the software publisher.

我猜这与编译器版本有关,但是自上次发布以来没有任何变化.

I'm guessing it's something to do with the compiler version but nothing has changed since it last published.

有什么想法吗?

推荐答案

错误:

编译错误

描述:资源编译期间发生错误 需要处理此请求.请查看以下具体内容 错误详细信息,并适当地修改您的源代码.

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

编译器错误消息:编译器失败,并显示错误代码 -2146232576.

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

解决方案:

在升级了一些NuGet之后,我遇到了这个问题,并通过以下步骤进行了解决.

Solution:

I faced with this problem after upgrade some NuGets and solved with below steps.

步骤1:NuGet Package Console

PM> Uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
PM> Uninstall-package Microsoft.Net.Compilers

第2步:在关闭Web.config

    <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>
            <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+"></compiler>
        </compilers>
    </system.codedom>

PS:一段时间后,我们已完全删除了<system.codedom>,以解决其他错误.

PS: After a while, we removed <system.codedom> completely, for fixed other errors.

这篇关于IIS编译错误-2146232576 AspNetInitializationExceptionModule的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆