0

Long story short, I was able to build a bitbucket .NET/MVC/Angular project successfully on windows 2019 azure hosted agent, but I am unable to make it build successfully on ubuntu agent. The reason I want to build it on ubuntu is because I noticed the build time is way faster than that of the windows agent, which makes sense considering the platforms.

I am facing this error:

Copying file from "/home/vsts/work/1/s/Bobby.ProjectA/obj/Debug/Bobby.ProjectA.pdb" to "/home/vsts/work/1/s/Bobby.ProjectA/bin/Bobby.ProjectA.pdb".
CopyRoslynCompilerFilesToOutputDirectory:
  Creating directory "/bin/roslyn".
  Creating directory "/bin/roslyn".
  Creating directory "/bin/roslyn".
  Creating directory "/bin/roslyn".

/home/vsts/work/1/s/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8/build/net45/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props(17,5): 
warning MSB3021: Unable to copy file "/home/vsts/work/1/s/packages/Microsoft.Net.Compilers.2.4.0/build/../tools/csc.exe" to "/bin/roslyn/csc.exe". Access to the path '/bin/roslyn' is denied. [/home/vsts/work/1/s/Bobby.ProjectA/Bobby.ProjectA.csproj]

According to this post, the issue is because the VBCSCompiler is locking the src.

So i have exhausted all of these solutions here to kill the VBCCompiler, but none of them worked. I also can't restart the ubuntu agent during a build due to CI limitation, and killall VBCSCompiler bash script before msbuild task resulted in this error: VBCSCompiler: no process found

So now i am stumped, if VBCSCompiler process is not even running, why is Access to the path '/bin/roslyn' denied???

Ive also tried updating/installing Microsoft.CodeDom.Providers.DotNetCompilerPlatform package per this post here, but that didnt do/help anything.

This is how my build tasks looks like if it helps:

build task

Cataster
  • 3,081
  • 5
  • 32
  • 79
  • What version of `Microsoft.CodeDom.Providers.DotNetCompilerPlatform` do you use? – Krzysztof Madej Dec 17 '20 at 23:18
  • @KrzysztofMadej not sure how to check that...would it be specified in the csproj file? I didnt write this project, I was just tasked with creating a build pipeline based on the project on bitbucket – Cataster Dec 18 '20 at 01:10
  • It depends how you reference nugets. It could in csproj or in packages.config file. Please check this for more info https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files – Krzysztof Madej Dec 18 '20 at 01:40
  • @KrzysztofMadej thank you i found it in `packages.config` and the version is `1.0.8`. ``. Also since theyre kinda related, `` – Cataster Dec 18 '20 at 04:27
  • Can you try update them to the newest version? – Krzysztof Madej Dec 18 '20 at 09:40
  • @KrzysztofMadej i was gonna do that but then i realized there are numerous locations where this could be referenced, and i am not sure what all the locations (files) are – Cataster Dec 18 '20 at 14:58
  • Run Ctrl+Shift to find accross all files. It pretty much should work on Visual Studio or Visual Code. – Krzysztof Madej Dec 19 '20 at 01:50

0 Answers0