Windows Forms WorkSpace not showing anything in solution explorer and attach to process

98 Views Asked by At

I have a problem with opening Windows Forms App as a project templates in visual studio 2022. When i'm opening template Windows Forms App(.Net Framework) i have everything in solution explorer(i mean photo 1) photo 1 but when im choosing template Windows Forms App i dont have anything in my solution explorer and i have to attach to process instead of debug app and it looks like this photo 2 I supposed that something is wrong with my .net cause when im using Windows Forms App(.Net Framework) i have the newest one .net 4.8.1 photo 3

I was trying to reinstall whole vs 2022 but it didnt work

1

There are 1 best solutions below

0
On BEST ANSWER

This is because your dotnet environment variables are configured incorrectly. Here is the situation I reproduced:

.net framework

enter image description here

.net

enter image description here

Then the correct solution to this issue is:

You can modify the environment variables and find the path "This PC -> Right click 'Properties' -> Advanced system settings -> Environment Variables –> System variables –> double click path"-> Delete "C:\Program Files (x86 ) \dotnet" and make sure there is "C:\Program Files\dotnet".

enter image description here

enter image description here

enter image description here

enter image description here

Of course, it may also be because "C:\Program Files\dotnet" is not the correct path. This requires you to find the correct installation location of your dotnet and modify it.

Finally, when your dotnet environment variables are configured correctly, you will find that everything is normal when you re-create a .net program.