Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish: Could not find a part of the path … \obj\DEV\AspnetCompileMerge\Source\bin\roslyn\csc.exe'

I recently added the new .NET compiler NuGet packages (Microsoft.CodeDom.Providers.DotNetCompilerPlatfor) to an existing older MVC.NET website. Now when trying to publish the website I get the following exception:

Could not find a part of the path … \obj\DEV\AspnetCompileMerge\Source\bin\roslyn\csc.exe'

I have tried everything mentioned in this question, but nothing worked. It is, after all, a slightly different problem. The problem mentioned in that post is build exceptions, my solution builds fine locally. Uninstalling the NuGet packages works, but that's not really a solution.

The issue is basically the same as this one, but that also has no solution.

Publish output:

4>------ Publish started: Project: Jdn.ArticleCatalogue.Web, Configuration: DEV Any CPU ------
4>Connecting to \\vm-arcawebdev01\WEBSITES\ArticleCatalogue...
4>Transformed Web.config using D:\DOTNET\Local\Logistics.Web\Portal\DEV\Application Projects\Article Catalogue\Jdn.ArticleCatalogue.Web\Web.DEV.config into obj\DEV\TransformWebConfig\transformed\Web.config.
4>Copying all files to temporary location below for package/publish:
4>obj\DEV\AspnetCompileMerge\Source.
4>C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p "D:\DOTNET\Local\Logistics.Web\Portal\DEV\Application Projects\Article Catalogue\Jdn.ArticleCatalogue.Web\obj\DEV\AspnetCompileMerge\Source" "D:\DOTNET\Local\Logistics.Web\Portal\DEV\Application Projects\Article Catalogue\Jdn.ArticleCatalogue.Web\obj\DEV\AspnetCompileMerge\TempBuildDir" -keyfile "..\..\..\Solution Items\Jdn.LogisticsPortal.snk" 
4>ASPNETCOMPILER(0,0): Error ASPRUNTIME: Could not find a part of the path 'D:\DOTNET\Local\Logistics.Web\Portal\DEV\Application Projects\Article Catalogue\Jdn.ArticleCatalogue.Web\obj\DEV\AspnetCompileMerge\Source\bin\roslyn\csc.exe'.

Any ideas on how to solve this one?

like image 370
Schoof Avatar asked Dec 24 '22 15:12

Schoof


2 Answers

This was a known issue whereby the Roslyn binary wasn't being copied correctly to the publish directory. It should be fixed if you install Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.7.

There seem to be some residual issues which are being tracked here.

like image 66
James Avatar answered Jan 01 '23 17:01

James


Same problem accourred to me while publish MVC .NET application to my local path. I solved the problem delete Microsoft.CodeDom.Providers.DotNetCompilerPlatform by nuget package.

like image 45
cinobili19 Avatar answered Jan 01 '23 17:01

cinobili19