Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

v1.0.6 of Microsoft.CodeDom.Providers.DotNetCompilerPlatform

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

like image 792
TheDestinyGroup Avatar asked Aug 07 '17 02:08

TheDestinyGroup


2 Answers

I had the same problem, it looks like a change in the Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props file under packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.6\build\net45

I added back in a target from the 1.0.5 version by adding back in

<Target Name="IncludeRoslynCompilerFilesToItemGroup" AfterTargets="ResolveAssemblyReferences" >
<ItemGroup>
  <None Include="@(RoslyCompilerFiles)" Condition="">
    <Link>%(RoslyCompilerFiles.Link)</Link>
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </None>
</ItemGroup>

before

<Target Name="CopyRoslynCompilerFilesToOutputDirectory" ... />

and publishing is working again.

I think it is being tracked here link

like image 106
Mark Burton Avatar answered Nov 15 '22 07:11

Mark Burton


1.0.7 was released. Please give it a try. If you see any issue, go to roslyncodedomprovider github repo and file an issue there.

like image 25
mattfei Avatar answered Nov 15 '22 06:11

mattfei