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"):
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.
If I grab the detailed compiler output and run it on the IIS server, I get a smartscreen error message saying:
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.
Any ideas?