4
votes

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?

2
Are you publishing the roslyn folder inside the bin folder?Paulo Morgado
I'm using the build in 'Publish Website' functionality of Visual Studio Web Projects.Schoof
Which build are you using in TFS,the old XAML build or the new vNext build? And could you share the detailed MSBuild Arguments and more related log?PatrickLu-MSFT
@Patrick-MSFT: I'm not entirely sure. I use the 'Publish' option of the right click menu of a Visual Studio Web Project (see: i.imgur.com/ThZLFtB.png). Which logs are you looking for and where could I find those? I have included the generated Build Output from Visual Studio in my initial question.Schoof
@Schoof If so, looks like you are encountering issue locally. It's not related to TFS build. Suggest you remove tfsbuild tag and add some tag such as msbuild, Nuget. Since without the newly Nuget package installed, everything works well.PatrickLu-MSFT

2 Answers

8
votes

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.

0
votes

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.