Upgrading an Azure .NET web app from 4.6 to 4.8 and when we published the staging version it worked, but the the identical site but with different database references threw this great error when it deployed.
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 -532462766.
Show Detailed Compiler Output:
C:\Windows\system32>C:\home\site\wwwroot\bin\roslyn\csc.exe /t:library /utf8output /nostdlib+ /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll"
This is after removing some old compiler packages like Microsoft.CodeDom.Providers.DotNetCompilerPlatform that are no longer required, during the upgrade. It seems that there were still references to them on hanging around on Azure.
These were quite useful:
https://stackoverflow.com/questions/32835601/the-command-exited-with-code-532462766
Removing these entries from web.config seemed to work for many people: remove this then rebuild and republish:
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
</compilers>
</system.codedom>
However for me this didn’t fix the problem. Interestingly, with Azure’s App Service Editor where you can fiddle with your live files, if I removed these lines from web.config then it suddenly worked! But then very odd other errors appeared in other parts of the app.
Solution for me? Deploy the app to a brand new container on Azure, I did it in Visual Studio – just create a new deployment to a new app, then copy across any settings, custom domains, etc. It’s a pain but it worked immediately with no further problems. I can only assume some settings stuck in Azure were not being wiped with redeployments and were causing the problems.
Comments