V1.0.6 from Microsoft.CodeDom.Providers.DotNetCompilerPlatform

When I update the dotNet MVC project to use Microsoft.CodeDom.Providers.DotNetCompilerPlatform v1.0.6, I get deployment problems because the roslyn directory no longer fits under the deployment bin directory.

I have v2.3.1 from Microsoft.Net.Compilers in my project, and nothing has changed in the project except updating Microsoft.CodeDom.Providers.DotNetCompilerPlatform through the NuGet Package Management function VS2015.

If I go back to version 1.0.5 of Microsoft.CodeDom.Providers.DotNetCompilerPlatform, everything works fine.

This updated version of Microsoft.CodeDom.Providers.DotNetCompilerPlatform seems to break / remove Microsoft.Net.Compilers links from the project.

I tried uninstalling and then reinstalling Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers from my project, but this does not solve the problem.

I tried the sentences in the next StackOverflow article without success.

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

I also tried to manually copy the roslyn directory to the output directory, but the directory is deleted every time the project is built.

I would appreciate it if anyone could help shed light on how to solve the problem.

Le

+5
source share
3 answers

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

I added back to the target from version 1.0.5, adding back to

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

front

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

and the publication is working again.

I think the link is being tracked here

+6
source

1.0.7 has been released. Please, try. If you see any problem, go to roslyncodedomprovider github repo and register the problem there.

+3
source

as I see in my project, deleting two lines from the csproj file solves the problem. two lines at the end of the csproj XML file, under the tag

<Target Name = "EnsureNuGetPackageBuildImports" BeforeTargets = "PrepareForBuild">

inside tag

 <PropertyGroup> 

Two lines:

 <Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props'))" /> <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.7\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.7\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" /> 

deleting them - the publication will return to work perfectly.

0
source

Source: https://habr.com/ru/post/1270639/


All Articles