I know this is an old thread but the issue is still current. The solution is to put the following code into the project file of your code library (this is for both WPF and Forms - edit as appropriate). Assuming that your code doesn't use features from the higher version.
4666350
02 Jan 2025, 17:37 ( Updated at: 02 Jan 2025, 19:00 )
RE: Cannot add Winform to .Net 6 cBot
PanagiotisCharalampous said:
I know this is an old thread but the issue is still current. The solution is to put the following code into the project file of your code library (this is for both WPF and Forms - edit as appropriate). Assuming that your code doesn't use features from the higher version.
<ItemGroup>
<FrameworkReference Update="Microsoft.WindowsDesktop.App;Microsoft.WindowsDesktop.App.WPF;Microsoft.WindowsDesktop.App.WindowsForms" TargetingPackVersion="6.0.0" />
</ItemGroup>
Best regards
Andy
@4666350