8
votes

I've been browsing the web for a couple hours now looking for an answer to my problem. I am trying to deploy a Web API on Azure Web App Service using VS2017. Everything builds and works fine when running locally but once deployed on Azure (through VS2017) I get this error:

D:\home\site\wwwroot\bin\roslyn\csc.exe

My project is an ASP.NET Web Application (Using Azure Web API template) .NET Framework 4.6.1. I use Microsoft.CodeDom.Providers.DotNetCompilerPlatform Version=1.0.6.0

I also made sure that csc.exe is located in:

Visual Studio 2017\Projects\DeviceManagementAPI\DeviceManagementAPI\bin\roslyn

4
Do you have code for this, and your desired output? See How to create a Minimal, Complete, and Verifiable example. - jmoon
Could you ensure that it is set as Copy Local = True? - Win
@Martin, I'd suggest rather than writing [Solved] in the title of the question. Mark one of the answers that helped you as accepted :) - Rohan Büchner

4 Answers

4
votes

Just had the same problem and it seems it's a known issue with Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.6 and 1.0.7.

Downgrading to 1.0.5 solves the problem.

1
votes

Upgrading Microsoft.CodeDom.Providers.DotNetCompilerPlatform to 1.08 worked for me

0
votes

After a while I simply uploaded manually the roslyn file directly into the server through Kudu. It seems to solve the problem but I still don't know why it won't upload automatically.

0
votes

Same issue might be caused by missing or incorrect relative packages path. If you're changing solution folder structure make sure all imports have proper path's to avoid missing Roslyn files.

Generally suggest to replace auto-generated ../../../packages/... rabit hole with parameter which will point to correct Nuget folder.

<Import Project="$(NugetPackagesPath)\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('$(NugetPackagesPath)\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />