Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSBuildExtras] Using msbuild extras under linux fails with missing Microsoft.WinFX.props #11108

Open
jeromelaban opened this issue Apr 2, 2020 · 9 comments
Milestone

Comments

@jeromelaban
Copy link
Contributor

MSBuild extras validates that projects can successfully build under a variety of .NET Runtimes and OSes, and a recent addition of validation of .NET Core 3.1 fails the build under Linux with the following error:

/__t/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props(208,3): 
error MSB4019: The imported project "/__t/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.

This error does not happen with .NET Core 3.0 and 2.2.

The error happens when building this project, with this script.

@jkotas jkotas transferred this issue from dotnet/runtime Apr 2, 2020
@marcpopMSFT marcpopMSFT added the untriaged Request triage from a team member label Apr 6, 2020
@dsplaisted
Copy link
Member

This seems like either an issue with MSBuildExtras itself, or just a limitation of the fact that building projects targeting UAP isn't supported on Linux.

FYI @clairernovotny

@dsplaisted dsplaisted removed their assignment Apr 9, 2020
@dsplaisted dsplaisted removed the untriaged Request triage from a team member label Apr 9, 2020
@dsplaisted dsplaisted added this to the Discussion milestone Apr 9, 2020
@mfkl
Copy link
Contributor

mfkl commented Apr 9, 2020

just a limitation of the fact that building projects targeting UAP isn't supported on Linux.

That's not it, you can reproduce with just

<Project Sdk="MSBuild.Sdk.Extras">
    <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
    </PropertyGroup>
</Project>

@jeromelaban
Copy link
Contributor Author

This error is caused by a casing issue, where the import here:

https://github.com/dotnet/wpf/blob/165948b449e9de9fbba9843c2695f32a3212158f/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props#L208

Does not match the casing in this folder:

gitpod@ws-XXX:/workspace/uno$ ll /usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets
total 72
drwxr-xr-x 2 root root  4096 Mar 18 17:39 ./
drwxr-xr-x 5 root root  4096 Mar 18 17:39 ../
-rw-r--r-- 1 root root 11191 Feb 28 17:55 Microsoft.NET.Sdk.WindowsDesktop.props
-rw-r--r-- 1 root root  6543 Feb 28 17:55 Microsoft.NET.Sdk.WindowsDesktop.targets
-rw-r--r-- 1 root root  1482 Feb 28 17:55 Microsoft.WinFx.props
-rw-r--r-- 1 root root 40124 Feb 28 17:55 Microsoft.WinFx.targets

@Nirmal4G
Copy link
Contributor

Nirmal4G commented Jun 4, 2020

The Fix is here: dotnet/wpf#2975

@ermshiperete
Copy link

Still happening even with the merged fix (SDK 3.1.302)

@ermshiperete
Copy link

This got fixed in dotnet/wpf@b198dcf - or at least the failing line removed in that commit.

@Nirmal4G
Copy link
Contributor

Nirmal4G commented Jul 29, 2020

It seems the fix is not merged into SDK 3.1.302! So, I've asked whether it is possible for back porting the fix into 3.1.

@worldbeater
Copy link

worldbeater commented Aug 18, 2020

The workaround implemented by Jerome in unoplatform/docker@8e13b5b finally made it possible to use MsBuild.Sdk.Extras with .NET Core 3.1 on my Linux machine! Posting this message here for dumb people like me who didn't notice this easy workaround when viewing the issue for the first time. Thank you @jeromelaban! <3

@moljac
Copy link
Contributor

moljac commented Jul 11, 2022

still issue in 3.1.421

fixed with:

sudo \
    cp \
    /usr/local/share/dotnet/sdk/3.1.421/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.WinFx.props \
    /usr/local/share/dotnet/sdk/3.1.421/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.WinFX.props

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants