Description
On my Ubuntu machine, I run into the error below when trying to compile a .NET Standard 2.0 class library using the MSBuild.Sdk.Extras
package (if I switch back to the default Microsoft.NET.Sdk
the error does't show):
error MSB4019: The imported project "/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.WinFX.props" was not found. Confirm that the expression in the Import declaration "Microsoft.WinFX.props" is correct, and that the file exists on disk.
Steps to reproduce:
- Create a new project using
dotnet new classlib
; - Update the project SDK in the .csproj file so it reads
<Project Sdk="MSBuild.Sdk.Extras">
; - Add a new file called
global.json
to the root of the project with the following content:
{
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "2.0.54"
}
}
- Restore all NuGet packages:
dotnet restore
- Build the project with
dotnet build
I have noticed that the Microsoft.WinFX.props
file does exists but spelled with a lower case "x". For now a workaround is to simply rename the file:
sudo mv "/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.WinFx.props" "/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.WinFX.props"
Not sure this is the correct place for this issue. But it looks like the Microsoft.WinFX.props
target is incorrectly referenced by the MSBuild.Sdk.Extras package since it is ment to be used fro WPF and WinForms projects which are not supported on Linux and MacOS. My assumption is this problem doesn't occur on MacOS since it doesn't use a case sensitive filesystem be default.