Is it possible to use WPF within an .NET Standard Class Library or is this to be reserved for .NET Core? If so, is it possible to setup a .NET Core Class Library that uses WPF or does it necessarily have to be a .NET Core App?
Finally, I got in contact with Microsoft. They were very helpful and provided the following snippet of a *.csproj file to me:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
</Project>
With this, I get a .NET Core class library including WPF. Additionally, I had to remove App.xaml and App.cs. This was necessary since those contain <Application> tags in XAML which aren’t allowed in WPF libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With