v1.0.6 of Microsoft.CodeDom.Providers.DotNetCompilerPlatform

Viewed 3270

When I update my dotNet MVC project to use v1.0.6 of Microsoft.CodeDom.Providers.DotNetCompilerPlatform I get deployment issues in that the roslyn directory is no longer placed under the bin directory of the deployment.

I have v2.3.1 of Microsoft.Net.Compilers in my project and nothing else is changed in the project other than updating Microsoft.CodeDom.Providers.DotNetCompilerPlatform via the Manage NuGet Packages feature of VS2015.

If I revert to v1.0.5 of Microsoft.CodeDom.Providers.DotNetCompilerPlatform all works fine.

It appears as if this updated version of Microsoft.CodeDom.Providers.DotNetCompilerPlatform is breaking / removing Microsoft.Net.Compilers references from the project.

I tried uninstalling and then re-installing Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers from my project but that doesn't solver the issue.

I tried the suggestions in the following StackOverflow article without success.

Could not find a part of the path ... bin\roslyn\csc.exe

I also tried to manual copy the roslyn directory to the output directory, but the directory is removed on each build of the project.

I would appreciate if anyone can help shed some light on how to resolve the problem.

Les

4 Answers

There was a typo in Github's Issue missing n (RoslyCompilerFiles) instead of RoslynCompilerFiles, fixed looks like this:

  <Target Name="CopyRoslynCompilerFilesToOutputDirectory" AfterTargets="CopyFilesToOutputDirectory">
    <Copy SourceFiles="@(RoslynCompilerFiles)" DestinationFolder="$(WebProjectOutputDir)\bin\roslyn" ContinueOnError="true" SkipUnchangedFiles="true" Retries="0" />
  </Target>

Btw my SampleWebApp.csproj from https://github.com/JonPSmith/SampleMvcWebApp had this instead (placed Roslyn next2):

  <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
    <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
  </Target>
Related