IIS Compilation Error -2146232576 AspNetInitializationExceptionModule

后端 未结 9 739
执笔经年
执笔经年 2020-12-05 07:35

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 follo

9条回答
  •  情话喂你
    2020-12-05 07:36

    Error:

    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.

    Solution:

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

    Step 1: Remove these NuGet packages from NuGet Package Console

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

    Step 2: Add these system.codedom lines before closing tag in Web.config

        
            
                
                
            
        
    

    PS: After a while, we removed completely, for fixed other errors.

提交回复
热议问题