dotnet restore in consoleCommand finishes successfully or with warning (see below)
Command finishes with error:
App.csproj(139,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-rc4-004771\Microsoft\WindowsXaml\v14.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
If I run from VS 2017 dev console error changes to:
App.csproj(139,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-rc4-004771\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
dotnet --info output:
.NET Command Line Tools (1.0.0-rc4-004771)
Product Information:
Version: 1.0.0-rc4-004771
Commit SHA-1 hash: 4228198f0e
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-rc4-004771
Cause of the issue is absence of Xaml CSharp targets. I think MSBuild seeks for them during parsing of
csproj on restore.
Same command finishes successfully if I use sdk version 1.0.0-preview2-1-003177.
Yep, at RTM of 1.0.0 CLI will not support Windows-specific scenarios. It had to during preview2 because there was not direct support for .NET Core in Visual Studio 2015. We may be able to bring in some OS-specific scenarios in the future, but for the time being this is out of scope. Moving to backlog.
Is there other way to restore packages? I.e. With msbuild or something like this. Or maybe somehow explicitly specify msbuild path that cli should use.
You can try restoring with msbuild /t:restore
Tooling support for UWP, Xamarin (with Xamarin Forms) would be fantastic. Hope to see it soon.
Most helpful comment
Tooling support for UWP, Xamarin (with Xamarin Forms) would be fantastic. Hope to see it soon.