How can we use classes like Screen in a .NET Core 3.0 WPF project? There are documentation pages for .NET Core 3.0 for them, so I assumed it should work.
VS and the compiler tell me that the namespace Forms
does not exist in System.Windows
, so it feels like the classes are not in the 3.0 sdk.
There is no System.Windows.Forms
package on nuget, and the "Add reference" dialog has only a System_Windows_Forms
reference to the .net framework available, which sounds horribly wrong:
Am I missing something?
NET Core and language features. Open source improvements to WPF and WinForms for . NET Core.
WinForms won't be deprecated until Win32 is ... which could be quite sometime! WPF on the other hand has few direct dependencies on Win32 so could potentially form the basis of a "fresh start" UI layer on a future version of windows.
You should add <UseWindowsForms>true</UseWindowsForms>
in your csproj.
<PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>netcoreapp3.0</TargetFramework> <UseWpf>true</UseWpf> <UseWindowsForms>true</UseWindowsForms> </PropertyGroup>
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