ClemensFischer / XAML-Map-Control

XAML Map Control Library
Microsoft Public License
206 stars 61 forks source link

Separate NuGet packages for different UI frameworks? #117

Closed ekdahl closed 5 months ago

ekdahl commented 5 months ago

If I have a WPF application targeting e.g. net6.0-windows10.0.18362.0, the WinUI library is referenced instead of the WPF library (that should be referenced). How can this be solved? Now, I need to remove the NuGet package and directly reference the DLL instead.

A few thoughts:

BR, Fredrik

ClemensFischer commented 5 months ago

How is a WPF app targeting net6.0-windows10.0.18362.0? There should be

<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWPF>true</UseWPF>

in the project file. I can't reproduce the issue.

ekdahl commented 5 months ago

Because this is not the only NuGet package used in my application. My application also uses this package, that needs net6.0-windows10.0.18362.0 (probably related to CsWinRT).

Source of project file here: https://github.com/iNKORE-NET/UI.WPF.Modern/blob/main/source/iNKORE.UI.WPF.Modern/iNKORE.UI.WPF.Modern.csproj

ClemensFischer commented 5 months ago

I have created another NuGet package XAML.MapControl.WPF that contains only the WPF versions.

ekdahl commented 5 months ago

Thanks a lot, very appreciated!

ClemensFischer commented 2 months ago

The same problem occured to another user with the MapProjections library. I am now going to follow your suggestion to provide only platform-specific NuGet packages.

I will keep the original package IDs without .WPF suffix for the packages that target WPF, and hence drop the XAML.MapControl.WPF package with the next release.

ClemensFischer commented 2 months ago

Or better, I will drop the original packages and keep only the one(s) with the .WPF suffix

OWiger commented 2 months ago

Or better, I will drop the original packages and keep only the one(s) with the .WPF suffix

This fixed my issue, thanks! :)