Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
MSBuild cuts the leading part of path to the output directory, but leaves the / separator at the start. This makes it want to create e.g. `/Debug` directory. The excerpt is from the md-addins build on Linux:
Copying file from "obj/Debug/net-4.5/GuiUnit.exe" to "../../bin/net_4_5/GuiUnit.exe".
GuiUnit_NET_4_5 -> /home/grendel/vc/xamarin/md-addins/external/guiunit/bin/net_4_5/GuiUnit.exe
Copying file from "obj/Debug/net-4.5/GuiUnit.exe.mdb" to "../../bin/net_4_5/GuiUnit.exe.mdb".
Copying file from "../../bin/Debug/net-4.5/nunitlite.xml" to "../../bin/net_4_5/nunitlite.xml".
Done Building Project "/home/grendel/vc/xamarin/md-addins/external/guiunit/src/framework/GuiUnit_NET_4_5.csproj" (default targets).
Creating directory "/Debug/".
/home/grendel/devel/mono/mono-master/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(4887,5): error MSB3191: Unable to create directory "/Debug/". Access to the path "/Debug/" is denied. [/home/grendel/vc/xamarin/md-addins/Xamarin.Ide/Xamarin.Ide.Tests/Xamarin.Ide.Tests.csproj]
Done Building Project "/home/grendel/vc/xamarin/md-addins/Xamarin.Ide/Xamarin.Ide.Tests/Xamarin.Ide.Tests.csproj" (default targets) -- FAILED.
Project "/home/grendel/vc/xamarin/md-addins/md-addins.sln" (1) is building "/home/grendel/vc/xamarin/md-addins/Xamarin.Forms.Addin/Xamarin.Forms.Addin.csproj" (26) on node 1 (default targets).
Creating directory "Packages".
Copying file from "../packages/Xamarin.Forms.18.104.22.168/Xamarin.Forms.22.214.171.124.nupkg" to "Packages/Xamarin.Forms.126.96.36.199.nupkg".
Copying file from "../packages/Xamarin.Android.Support.v188.8.131.52/Xamarin.Android.Support.v184.108.40.206.nupkg" to "Packages/Xamarin.Android.Support.v220.127.116.11.nupkg".
Copying file from "../packages/Xamarin.Android.Support.Design.23.3.0/Xamarin.Android.Support.Design.23.3.0.nupkg" to "Packages/Xamarin.Android.Support.Design.23.3.0.nupkg".
Copying file from "../packages/Xamarin.Android.Support.v7.AppCompat.23.3.0/Xamarin.Android.Support.v7.AppCompat.23.3.0.nupkg" to "Packages/Xamarin.Android.Support.v7.AppCompat.23.3.0.nupkg".
Copying file from "../packages/Xamarin.Android.Support.v7.CardView.23.3.0/Xamarin.Android.Support.v7.CardView.23.3.0.nupkg" to "Packages/Xamarin.Android.Support.v7.CardView.23.3.0.nupkg".
Copying file from "../packages/Xamarin.Android.Support.v7.MediaRouter.23.3.0/Xamarin.Android.Support.v7.MediaRouter.23.3.0.nupkg" to "Packages/Xamarin.Android.Support.v7.MediaRouter.23.3.0.nupkg".
Copying file from "../packages/Xamarin.Android.Support.v7.RecyclerView.23.3.0/Xamarin.Android.Support.v7.RecyclerView.23.3.0.nupkg" to "Packages/Xamarin.Android.Support.v7.RecyclerView.23.3.0.nupkg".
Copying file from "../packages/Xamarin.Android.Support.Vector.Drawable.23.3.0/Xamarin.Android.Support.Vector.Drawable.23.3.0.nupkg" to "Packages/Xamarin.Android.Support.Vector.Drawable.23.3.0.nupkg".
Copying file from "../packages/Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0/Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0.nupkg" to "Packages/Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0.nupkg".
Creating directory "build/".
Creating directory "/DebugLinux/".
/home/grendel/devel/mono/mono-master/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(1076,5): warning MSB3191: Unable to create directory "/DebugLinux/". Access to the path "/DebugLinux/" is denied. [/home/grendel/vc/xamarin/md-addins/Xamarin.Forms.Addin/Xamarin.Forms.Addin.csproj]
The previous error was converted to a warning because the task was called with ContinueOnError=true.
Build continuing because "ContinueOnError" on the task "MakeDir" is set to "True".
Creating directory "/DebugLinux/".
This is happening with the following versions:
Mono JIT compiler version 5.1.0 (master/68c053315e2 Thu 6 Apr 14:06:52 CEST 2017)
Microsoft (R) Build Engine version 18.104.22.168
Created attachment 21409 [details]
diagnostic build log
The attached log is not diagnostic. Could you run msbuild with `/fl /flp:v=diag` and attach the generated msbuild.log?
I've just seen it happen on OSX too with
Microsoft (R) Build Engine version 22.214.171.124 (xplat-2017-02/3738dec Tue Apr 4 17:23:12 EDT 2017)
Mono JIT compiler version 126.96.36.199 (2017-02/dda961c Tue Apr 4 17:07:38 EDT 2017)
while building Xamarin.AndroidSDK.Manager.sln from https://github.com/xamarin/android-sdk-installer
Verbose log will follow
Created attachment 22280 [details]
Log for the issue in previous comment
Created attachment 22281 [details]
Another build log
The same happens with
Mono JIT compiler version 188.8.131.52 (2017-04/8a3993f Thu May 18 09:17:44 EDT 2017)
Microsoft (R) Build Engine version 184.108.40.206 (d15.3/e5db6a9 Tue May 9 15:02:19 EDT 2017)
but I'm starting to wonder if it's my particular configuration... I have XA in the path, maybe it confuses msbuild somehow? But then, xbuild works fine...
Possibly related: conversation from:
Summary: the behavior described in Comment #0:
> Creating directory "/Debug/"
could be explained by using `msbuild` when overriding the `$MSBuildExtensionsPath` environment variable. When this happens, `Microsoft.Common.props` isn't found/imported, causing the `$(BaseIntermediateOutputPath)` property to be empty. As this is the property which is *normally* `obj`, resulting in e.g. `obj/Debug` for `$(IntermediateOutputPath)`, `$(BaseIntermediateOutputPath)` being empty breaks *everything*.
As confirmation, of sorts, Attachment #22280 [details] doesn't mention `Microsoft.Common.props`. A normal build *should*, e.g.
> Trying to import /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/xbuild/$(MSBuildToolsVersion)/Microsoft.Common.props using extensions path /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/xbuild
Additionally, Attachment #22280 [details] contains:
> Search paths being used for $(MSBuildExtensionsPath) are /Users/grendel/vc/xamarin/monodroid/out/lib/xbuild:/Library/Frameworks/Mono.framework/External/xbuild/
further suggesting that `$MSBuildExtensionsPath` is being overridden.
Indeed, as @Jonp suggests in comment 7, the reason for this was presence of the MSBuildExtensionsPath in the shell environment while running msbuild. Unsetting the variable makes the build work.