I recently started to update my .NET code from .NET Framework 4.8 to .NET 8.0. The solution contains a library, a WinForms EXE and a WPF EXE.
My program runs fine in debug mode (inside of Visual Studio). But when I start the executable file (both of them) in my build folder I only get an error message telling me, that I need to install .NET to run this program. Sometimes it tells me to install .NET Desktop Runtime instead of .NET.
But even after I followed the provided download link and installed the downloaded software, nothing changes, I still can’t run my program.
My project file contains the following bits:
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
CoPilot told me to add a node and a node, but these didn’t do anything for me.
Why do I need to download an install .NET? I’m on the same machine I compiled the program on. Shouldn’t everything I need already be installed?
And why doesn’t my program recognizes the installed software?
What can I do to get my program running on my machine and on any other machine?