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 for Bug 58254 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
When trying to use `dotnet restore` on a Xamarin.Android project, it fails with the following error message:
C:\Users\dougl\Documents\Visual Studio 2017\Projects\App43\App43\App43.csproj(79,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.4\Xamarin\Android\Xamarin.Android.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Looking at the resolved $(MSBuildExtensionsPath) path which in this case is C:\Program Files\dotnet\sdk\1.0.4\Xamarin\Android\Xamarin.Android.CSharp.targets there does not exist such as file.
Rather the targets exist at the following resolved path:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets
I've also tried this with .NET Core 2.0 preview 2 bits and it seems to be the same behavior:
C:\Users\dougl\Documents\Visual Studio 2017\Projects\App43\App43\App43.csproj(79,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.0.0-preview2-006497\Xamarin\Android\Xamarin.Android.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I believe this in theory would also happen in Xamarin.iOS as the targets will be missing.
.NET Core 2.0.0 Preview 2
Microsoft Visual Studio Enterprise 2017
Version 15.2 (26430.16) Release
Microsoft .NET Framework
Installed Version: Enterprise
Xamarin 220.127.116.116 (fec6f88)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android SDK 18.104.22.168 (9dbc4c5)
Xamarin.Android Reference Assemblies and MSBuild support.
Xamarin.iOS and Xamarin.Mac SDK 10.10.0.37 (ad35de4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
As a workaround, one would have to use msbuild via:
msbuild /t:restore MyApplication.sln
msbuild /t:restore MyApplication.csproj
However we all want to use that shiny new `dotnet restore` command!
It worked for me.
Changing importance to Enhancement Request.
For reference, here's a related Developer Community report: