Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Revert C# class template to default one

I have just installed StyleCop 4.5 and default templates have been replaced with some I don't really appreciate right now. How can I revert it to default?

like image 796
mrzepa Avatar asked Aug 12 '11 17:08

mrzepa


3 Answers

I solved that. There's possibility to revert that changes, because visual has backups for old classes templates.

All templates are placed in folder like this: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033

After reverting there is one more thing to do, open cmd and enter command: devenv /setup

This will update changes.

like image 69
mrzepa Avatar answered Oct 23 '22 09:10

mrzepa


Not sure which exact version you are using, but on the latest version (4.6.3.0 which should be equivalent to the latest 4.5 but with R# 6.0 compat) if you rerun the StyleCop installer, you can change the installation including uninstalling the VS templates while leaving the rest of the installation intact.

like image 37
Mike Avatar answered Oct 23 '22 11:10

Mike


I had this same problem, but took me a bit to figure out that it was stylecop that had caused my templates to change.(I had not coded in a while after installing the new stylecop version)

Anyways, to fix this issue, I installed the latest version of style cop and then un-installed. They have fixed the later version installer to ensure it reverts your visual studio templates back to the vs default templates.

Finally, I installed the latest version again and during the install I made sure to Exclude updating the visual studio templates.

I hope this helps someone else.

like image 42
Brian Avatar answered Oct 23 '22 10:10

Brian