hi, anytime i try to add new item to create a class and my visual studio 2019 stops working

Joined
Jun 3, 2021
Messages
10
Programming Experience
Beginner
Hi, i am learning c# by myself and recently i realized my visual studio 2019 couldn't create any new project, immediately after having two projects created and also the old project which i kept on constantly using to practice, once i try to open a new item to create a class for object, it sends this message; exception of type 'system.exception' was thrown.
Please, i will appreciate any answers to solve this issue. thanks.
 
Last edited:

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,904
Location
Sydney, Australia
Programming Experience
10+
Just to confirm are you saying that you cannot create new projects, you can't add new items to a specific project, you can't add new items to any project or a combination thereof? If the issue is not confined to one specific project, I think the first thing to do is to try repairing VS, which will replace any corrupt or missing files. Run the VS installer and select the Repair option and see how you go.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,364
Location
Chesapeake, VA
Programming Experience
10+
+1 about trying out Repair as a first step.

Also, if there is any chance your joined the bandwagon of using the Cascadia Code font? Try switching back to Consolas. VS2019 started randomly not opening code files for me when I tried switching over to Cascadia Code to see what the fuss was all about. I switched back to Hack as my default editing font and things worked better again., I'm trying out the Cascadia Code experience in VS Code instead.
 
Joined
Jun 3, 2021
Messages
10
Programming Experience
Beginner
Just to confirm are you saying that you cannot create new projects, you can't add new items to a specific project, you can't add new items to any project or a combination thereof? If the issue is not confined to one specific project, I think the first thing to do is to try repairing VS, which will replace any corrupt or missing files. Run the VS installer and select the Repair option and see how you go.
yh very sorry about that, actually its both and i did what you said but still the same issue persists ; when i try to open a new project, it sends this message(error parsing user settings file) and with the other it just shows the same message (Exception of type 'system.exception' was thrown).
 
Joined
Jun 3, 2021
Messages
10
Programming Experience
Beginner
+1 about trying out Repair as a first step.

Also, if there is any chance your joined the bandwagon of using the Cascadia Code font? Try switching back to Consolas. VS2019 started randomly not opening code files for me when I tried switching over to Cascadia Code to see what the fuss was all about. I switched back to Hack as my default editing font and things worked better again., I'm trying out the Cascadia Code experience in VS Code instead.
yh i checked that too and its exactly on Consolas. but the issue still remains
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,364
Location
Chesapeake, VA
Programming Experience
10+
I'm away from my PC right now, but if the issue is corrupt user settings, you'll need to run "devenv.exe /reset" . That should bring you back to Out Of The Box settings. I need to get to a PC to confirm, that the parameter is really "/reset". In the meantime you can likely Google it yourself about devenv command line parameters.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,364
Location
Chesapeake, VA
Programming Experience
10+
Finally got to my PC. It's "/ResetSettings"
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
1,194
Location
Norway
Programming Experience
10+
Something I've read a lot about lately is Windows ransomware protection with Controlled Folder Access. This is something I tested out a few years back and got into never ending troubles - maybe it has gotten better? Basically I had to disable it whenever I installed or updated any application, and I also had to manually whitelist many application executable paths for them to work properly in every day operations. The error messages and problems that occured were at no help, but I soon discoved that whenever something got weird or didn't work CFA was to blame. So if you have jumped on that wagon try install/repair with it disabled. Try running VS with CFA disabled if you encounter weird behaviour.

* One thing I remember is that I had to whitelist my own testing apps writing to Documents folder, else I got DirectoryNotFoundException or FileNotFoundException for existing paths.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,364
Location
Chesapeake, VA
Programming Experience
10+
If it still keeps crashing. Go to Help.Send Feedback>Report a problem... in Visual Studio. I was quite surprised how responsive they were when I reported two different issues is the past. I was expecting to perhaps get a response in 2-3 weeks time, but I got communications within 2-5 days.

Provide as much detail as you can when you put in your report. I know that whenever I receive a bug report, I am more willing to help out the user who gives me clear concise steps on how to reproduce the problem, details about their configuration, and observations of what seems to be going wrong, etc. rather than the vague bug report that just says something failed.
 
Joined
Jun 3, 2021
Messages
10
Programming Experience
Beginner
Something I've read a lot about lately is Windows ransomware protection with Controlled Folder Access. This is something I tested out a few years back and got into never ending troubles - maybe it has gotten better? Basically I had to disable it whenever I installed or updated any application, and I also had to manually whitelist many application executable paths for them to work properly in every day operations. The error messages and problems that occured were at no help, but I soon discoved that whenever something got weird or didn't work CFA was to blame. So if you have jumped on that wagon try install/repair with it disabled. Try running VS with CFA disabled if you encounter weird behaviour.

* One thing I remember is that I had to whitelist my own testing apps writing to Documents folder, else I got DirectoryNotFoundException or FileNotFoundException for existing paths.
cant find controlled folder access in my windows 10
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
1,194
Location
Norway
Programming Experience
10+
Joined
Jun 3, 2021
Messages
10
Programming Experience
Beginner
hey, okay so I uninstalled and reinstalled through the visual studio installer. Opened it now but i cant create a project, cause the only thing it shows is blank solution. Please any thoughts on what to do.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,364
Location
Chesapeake, VA
Programming Experience
10+
After reinstalling, what is current version now? You should be at 16.10.3 at least by now.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,364
Location
Chesapeake, VA
Programming Experience
10+
*sigh* That's not the question I was asking. I was just asking you to verify that you have at least version 16.10.3 of VS2019.

By adding more tools and features, your are complicating things because now more things have to be loaded by VS2019, and thereby making the failure matrix bigger. If you stick with the basic C# developer profile for desktop development, you should get the basics running. Once that is working, then you should put in the extras.
 
Joined
Jun 3, 2021
Messages
10
Programming Experience
Beginner
*sigh* That's not the question I was asking. I was just asking you to verify that you have at least version 16.10.3 of VS2019.

By adding more tools and features, your are complicating things because now more things have to be loaded by VS2019, and thereby making the failure matrix bigger. If you stick with the basic C# developer profile for desktop development, you should get the basics running. Once that is working, then you should put in the extras.
oh cr!!p, please how do i get the basic C# developer profile for desktop development.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,364
Location
Chesapeake, VA
Programming Experience
10+
Screenshot_1.png
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,904
Location
Sydney, Australia
Programming Experience
10+
What
You have to wonder why Microsoft don't provide a clear description of each of those workloads so that anyone who could be bothered to look would see what each one does and not have to ask others. Oh look, they do.
 
Joined
Jun 3, 2021
Messages
10
Programming Experience
Beginner
hey it seems to be working, i reall
i have been able to create the projects but now i just wanted to find out which tar
hey skydiver thanks a lot, i can see the options to create a project but i just wanted to ask which target framework ( NET 3.1 0R NET 5.0) would be best or it doesn't really matter
 
Top Bottom