4

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?

Schoof
  • 2,715
  • 5
  • 29
  • 41
  • Are you publishing the `roslyn` folder inside the `bin` folder? – Paulo Morgado Aug 05 '17 at 23:43
  • I'm using the build in 'Publish Website' functionality of Visual Studio Web Projects. – Schoof Aug 06 '17 at 09:43
  • 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 Aug 09 '17 at 01:26
  • @Patrick-MSFT: I'm not entirely sure. I use the 'Publish' option of the right click menu of a Visual Studio Web Project (see: http://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 Aug 09 '17 at 13:28
  • @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 Aug 09 '17 at 14:24
  • @Patrick-MSFT We also have a TFS build running that gets the same exception. MSBuild Arguments: `/p:OutputPath=bin/$(BuildConfiguration) /p:DeployOnBuild=true /p:PublishProfile="DEV"`. But you are correct, I changed the tags. Thanks for the feedback! :) – Schoof Aug 10 '17 at 07:16
  • Possible duplicate of [Could not find a part of the path ... bin\roslyn\csc.exe](https://stackoverflow.com/questions/32780315/could-not-find-a-part-of-the-path-bin-roslyn-csc-exe) – jrummell Aug 11 '17 at 12:36
  • @jrummell: I linked to that in my question and stated that none of the answers work and it's a slightly different issue. – Schoof Aug 11 '17 at 16:39
  • @Schoof have you tried downgrading the package to 1.0.5 or 1.0.3 as suggested in that question? – jrummell Aug 11 '17 at 19:57

2 Answers2

8

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.

James
  • 7,343
  • 9
  • 46
  • 82
2

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.

cinobili19
  • 451
  • 7
  • 10