我有一个相当简单的C#WebAPI2项目,本地运行但在远程计算机(Windows Server 2012 R2 Standard)上发布到IIS后,网页显示以下内容(将customErrors设置为“Off” ):IIS编译错误-2146232576 AspNetInitializationExceptionModule
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.
如果我抢了detailed compiler output和IIS服务器上运行它,我得到一个smartscreen error message说:
This app can't run on your PC. To find a version for your PC, check with the software publisher.
我猜这是什么做的编译器版本,但什么事都没有自从它改变了上次发布。
任何想法?
好的,所以事情变成了**。 Newtonsoft.Json软件包在我没有意识到的情况下进行了更新和签入,似乎将项目的目标框架从4. – feganmeister
提升到了.NET 4.5.2,这也可能是由Microsoft.CodeDom.Providers.DotNetCompilerPlatform引起的。 'Microsoft.Net.Compilers包'删除它们,然后重新部署并观察您的问题消失:P –