dotnet / dotnet/sdk

WindowsBase version conflict between Microsoft.WindowsDesktop.App and Microsoft.NETCore.App

Open
#41,909 4 comments 1 reaction 1 assignee Claimed by @marcpopMSFT View on GitHub
Area-NetSDK
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

We're getting an MSB3277 Warning for a conflict between WindowsBase 4.0.0.0, coming from an implicit Microsoft.NETCore.App Framework reference and Version 8.0.0.0 which is coming from a Microsoft.WindowsDesktop App.

We have assemblies with Windows-Forms and we have assemblies without UI components which should do not need a framework reference to Microsoft.WindowsDesktop.App. The default reference to Microsoft.NETCore.App should be enough. But compiling these assemblies gives us the MSB3277 Warning stating that the older version 4.0.0.0 from NETCore.App is used instead of 8.0.0.0

Searching the internet i find suggestions where other developers enable "UseWPF" in their projects (to force a framework reference to Microsoft.WindowsDesktop.App) and therefore explicitly referencing version 8.0.0.0 in the project. This is not a solution. Certainly not for us, because we still use Windows-Forms and not WPF.

Another Hack to get around the problem seems to be adding an explicit framework reference to Microsoft.WindowsDesktop.App and thereby referencing version 8.0.0.0 of WindowsBase. This also gets rid of the warning and our code works with this hack. But this can't be the real solution for the problem in the SDK.

Is there a better way or should we wait for the version incompatibility gets fixed in the SDK?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.