我有一個相當簡單的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 –