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

TOUJOURS SEUEL

New member
Joined
Jun 3, 2021
Messages
4
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,792
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,122
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.
 

TOUJOURS SEUEL

New member
Joined
Jun 3, 2021
Messages
4
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).
 

TOUJOURS SEUEL

New member
Joined
Jun 3, 2021
Messages
4
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,122
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,122
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,183
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,122
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.
 
Top Bottom