Skip to content

error MSB4019: "Microsoft.WinFX.props" was not found #224

Open
@mvanbeusekom

Description

@mvanbeusekom

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:

  1. Create a new project using dotnet new classlib;
  2. Update the project SDK in the .csproj file so it reads <Project Sdk="MSBuild.Sdk.Extras">;
  3. 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"
  }
} 
  1. Restore all NuGet packages: dotnet restore
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions