Visual Studio Broken After Uninstalling StyleCop

May 16, 2011 at 12:28 PM


I've just created two related issues:

I'm posting this discussion to ask for help because I'm now missing at least one very important Visual Studio template since I've uninstalled the latest vesrion of StyleCop in an attempt to get back my default Visual Studio templates.

Did the StyleCop installer at least make a copy of them on my computer before replacing them?  If so, where?


May 16, 2011 at 2:32 PM

Yes. I'll fix it in the next version. During install the original files are copied alongside with ".bak" added to the filenames. Default install you will find them here: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Code\1033

May 16, 2011 at 2:57 PM


Although, removing ".bak" from the filenames doesn't fix the problem for me - the Class, CodeFile and Interface templates still aren't showing up in the Add New Item dialog.

I also tried restarting VS twice.  What am I missing?  Any registry stuff?

Note there are other .zip files in the same directory that appear to have been installed by VS, so it seems that I'm in the correct place.

- Dave

May 16, 2011 at 2:59 PM

Close VS and then run:


devenv.exe /setup 

from a cmd line.

May 17, 2011 at 2:27 AM
Edited May 17, 2011 at 2:28 AM

Thanks for the solution.  Running devenv.exe /setup solved the problem.

- Dave

May 21, 2011 at 10:44 PM

4.5.16 also fixes this issue on install/uninstall now too.

Jul 6, 2011 at 12:11 PM

Ok, I had the same problem, and started with deinstalling StyleCop, but was not enough, I had to restore the default templates (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Code\1033) from a colleague machine because they were removed!

Then, devenv.exe /setup and I got the default VS template again!

Then I reinstall StyleCop without "Visual studio templates" (which should IMHO and as Dave suggested be unchecked by default: it is too dangerous to change such profile in well established processes in enterprise development!)

May 24, 2012 at 1:24 PM

Just hit this issue.. Horrible!

May 24, 2012 at 1:49 PM


Aug 9, 2012 at 1:50 PM

Dealing with this issue right now. Not impressed.

Aug 9, 2012 at 5:25 PM
Don't use it anymore then. Easily fixed.


On 9 Aug 2012, at 14:50, nichardrixon <> wrote:

From: nichardrixon

Dealing with this issue right now. Not impressed.

Feb 27, 2014 at 1:08 PM
Edited Feb 27, 2014 at 1:17 PM
Wow, still an issue in 2014 with StyleCop 4.7. Regretting having installed in the first place.
StyleCop can't be uninstalled from Control Panel (fails to find install log...) but did uninstall when I re-ran the msi and selected "Uninstall". However, even then, the C:\Program Files (x86)\MSBuild\StyleCop folder survives the uninstall and has to be deleted manually. Then when restarting VS, the IDE still has StyleCop settings references that have survived the uninstall as well as the manual delete and cause exceptions when loading VS.

Just, wow. How did this stuff ever get through QA?
Oct 20, 2014 at 5:11 PM
StyleCop is a virus I cannot remove. I've tried devenv /setup several times to no avail.
Oct 21, 2014 at 2:55 AM
@camainc, have you tried deleting the registry keys (see @TomBallard's post here), then installing the latest version of StyleCop, then uninstalling it? Hopefully this will leave your system clean.
Mar 2 at 3:10 AM
I know this discussions is too old, but I just got this problems.
So I post to confirm that "devenv /setup" can solve this problem.

But if someone try this but can't solve, please check your latest visual studio folder.
At first I try to run command at "x86\Microsoft Visual Studio 10.0..." nothing happen, problem still exists.
But when I run command at "x86\Microsoft Visual Studio 12.0...", it can fixed.

Hope this helpful for someone that just found this problem.