Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Hi @Ron Oakes , Welcome to Microsoft Q&A,
First you need to make sure you are creating a Winforms project or a WPF project.
Make sure your project file (.csproj) target framework is correctly set to net8.0-windows.
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF> <!-- or <UseWindowsForms>true</UseWindowsForms> -->
</PropertyGroup>
</Project>
You don't need to manually add the Microsoft.WindowsDesktop.App.Ref package because it is automatically included when you set the target framework to net8.0-windows. If this package has already been added, try removing it and restoring the NuGet package.
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.