I have a solution that contains several .NET Standard, .NET Core, .NET 6, and finally UWP projects in it.
Additionally, I have test projects for everything, including the UWP projects.
My problem is, is that I cannot run the dotnet test
, or even the dotnet build
, command on my solution and have it actually work. I get the following exception each time I attempt to use a dotnet
command on the solution:
error MSB4019: The imported project "C:\Program Files\dotnet\sdk\6.0.100\Microsoft\WindowsXaml\v17.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\6.0.100\\Microsoft\WindowsXaml\v17.0\Microsoft.Windows.UI.Xaml.CSharp.targets" is correct, and that the file exists on disk.
It appears to happen any time that I have a UWP project in my solution.
This is frustrating, because I would like to have one (think build system) way to restore, build, and test my solution with multiple project types.
In order to do anything with my whole solution, I need to resort to using MSBuild commands for build operations, such as msbuild /t:restore
, or vstest.console
commands when targeting my UWP tests. When not targeting UWP projects, I can use dotnet
commands like normal.
Are the dotnet
command line operations just not suitable for building and testing mixed solutions like mine? Or is there something that I am missing?