[RESOLVED] Adding System.Windows.Forms to .Net 8 dll
From everything I have seen, this should be possible, but for some reason, I haven't been able to add System.Windows.Forms to a .Net 8 class library project. I need to add a custom cursor, which is the immediate issue, but I realized I will eventually want to add a form to this class library. I would have thought that I could add this through NuGet, but it isn't showing up. All I'm seeing online makes it seem like this should be nothing special. There aren't any instructions, because there clearly don't need to be, yet I'm not seeing it.
What am I missing?
Re: Adding System.Windows.Forms to .Net 8 dll
Create new project as Windows Forms Class Library and you will have all that you need. Check the created .vbproj as it contains required settings. For example:
Code:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>WinFormsLibrary1</RootNamespace>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Windows.Forms" />
</ItemGroup>
</Project>
Re: Adding System.Windows.Forms to .Net 8 dll
Yeah, that gets it. Adding the missing parts to .vbproj also works. Strange that I couldn't find it, though.