I'm trying to create a basic C# .NET project WITH WINDOWS FORMS to work, but nothing works. For some reason, when you follow the the directions in https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-43564EB9-F843-4771-823C-573495EE23E0 which supposedly how to create a new project in .NET, there is no option int the project explorer to add a new form.
This is something basic that should be covered. .NET without forms is ridiculous.
It is not AutoCAD programming issue, strictly speaking. It is how to do .NET Core (since .NET 5) with Visual Studio.
If you followed mentioned link to create a class library project, by default the project does not include references to UI libraries for Win Form and WPF UI. So, in the project if you right-click the project and select "Add New Item...", the new item dialog box would not show UI related items, nor the right-clicked context menu shows those. In order to use WinForm/WPF UI items in the class library, you need to edit the project file (*.csproj) by right click the project and select "Edit Project File". You need to add following <ItemGroup>:
<ItemGroup>
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" />
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WPF" />
</ItemGroup>
Also, in the <PropertyGroup>, add
<PropertyGroup>
...
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true<.UseWPF.
</PropertyGroup>
Note, these add both Windows Form and WPF references. you can choose only add one of them, if you wish.
HTH
open your csproj file of your project ,add options like this to use windowsforms or wpf
Can't find what you're looking for? Ask the community or share your knowledge.