novotnyllc / MSBuildSdkExtras

Extra properties for MSBuild SDK projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't find version 3.x

bddckr opened this issue · comments

Hey there! Thanks a lot for this project and the continued work on it.

The readme states

Important: 3.x of the Extras requires the .NET 5 SDK or later. The SDK can build previous targets, like netcoreapp3.1. The extras 2.x supports SDK 2.x and 3.x.

But I can only see version 2.1.2 in the nuget.org feed and 2.1.6 in the CI feed.

As I'm getting some warning using the .NET 5 SDK (v5.0.100) I thought I'd try to update.

4>C:\Users\bddckr.nuget\packages\msbuild.sdk.extras\2.1.2\Sdk\Sdk.props(25,3): warning MSB4011: "C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.NET.Sdk.WindowsDesktop.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.props (147,3)". This is most likely a build authoring error. This subsequent import will be ignored.

commented

Same thing here.
We would like to switch to .NET 5 but couldn't find any branch with this supposed 3.x, maybe it's only a plan so far?

Doesn't exist yet.... been busy with a number of other things. The 2.x version does work, just ignore the warnings. 3.x probably won't be out until mid-late December due to other commitments. PR's are welcome.

I'm seeing MSB4011 in one of my libraries aswell as other ones out & about (like the XamarinCommunityToolkit).

/Users/alex.duffell/.nuget/packages/msbuild.sdk.extras/2.1.2/Sdk/Sdk.props(25,3) : 
warning MSB4011: "/usr/local/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props" 
cannot be imported again. It was already imported at 
"/usr/local/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.props (147,3)". This is most likely a build authoring error. This subsequent import will be ignored. 
[/Users/alex.duffell/Documents/GitHub/XamarinCommunityToolkit/XamarinCommunityToolkit/Xamarin.CommunityToolkit.csproj]

Is there anyway I can suppress these warnings until a new version released?

I've tried <NoWarn>MSB4011</NoWarn> and <MSBuildWarningsAsMessages>MSB4011</MSBuildWarningsAsMessages> but no luck so far 😅

@dsplaisted @rainersigwald do you know if this warning can be suppressed?

I tried the NoWarn approach as well :-) . I even tried adding an extra _ExtrasWindowsSdkAlreadyImported (if TargetFramework ends with "windows"), but my real problem was I had to update to NuGet 5.8 which isn't available via nuget update -self yet.

do you know if this warning can be suppressed?

Not at the moment: dotnet/msbuild#4038

Version 2 from nuget.org does not work for me with .NET 5 projects, but I can use current one from this repository packaged into custom nuget.
We still have some warnings but can live with it for now.
There is still one problem we are investigating: NuGet/Home#10289.

I've created a PR #249 which should fix the build warning.
I've modified the Sdk.props locally to fix the warnings on my machine but I have not verified yet if it solves the problem of running "nuget restore" on the build server, but at least "msbuild /t:Restore mysolution" now works locally so it looks promising