Slow compile times when Visual Studio 2012 is open

c#, visual-studio-2010

Solution

I've figured this out. I believe it was the result of some malware. I diagnosed the problem with the following steps.

- Download ProcMon (http://technet.microsoft.com/en-gb/sysinternals/bb896645.aspx)

- Add a filter to ProcMon on process name: csc.exe

- I then ran a compile from the command line, with visual studio open. It took around 10 seconds, way too long! Looking at the output in the ProcMon window, I noticed what appeared to be csc.exe pausing for 5 secs, once towards the beginning of the trace, and once towards the end. See the following screens:

Start:

End:

It appeared that a RegCloseKey to HKLM\SOFTWARE\Wow6432Node\5c28f8fbc6fe942 was causing csc.exe to wait for 5 seconds, twice.

RegKey:

I then decided to rename this entry (added _old to the end), I then recompiled....BINGO, it compiled in less than 30ms!

After studying the entries contained in this key and some googleing it turned out that this reg key was the result of some malware. I used the following guide to remove thte malware and now the problem is completely solved.

http://www.explosiveknowledge.net/main/2012/08/19/browsemngr/

Please be aware that the guide above doesn't contain the correct reg entries, I think the virus must have been tweaked at somepoint, I couldn't find the reg entries mentioned in the guide but simply deleted the ones I'd found.

Please note that the 5c28f8fbc6fe942 part of the reg key seems to be randomly generated. If you have this problem is might be different but the values contain within will still talk about "Browser Manager".

Hope this helps someone!

Problem

Afternoon all, I have a very strange problem. When VS 2012 is open, compile times are very slow. This slow compile time is present when building via VS and/or directly via csc.exe from the command line. To test: Create a folder with the following items: A batch file (compile.bat) containing: ``` echo %time% csc /target:library class1.cs echo %time% ``` and a class1.cs containing: ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ClassLibrary1 { public class Class1 { } } ``` Now open a visual studio command prompt. Navigate to the above folder and run the batch command, without VS open. On my machine, this takes approximately 10ms, perfect. I now open VS 2012, open no solution, do nothing other than open the the application so that devenv is running. Now repeat the test by running the batch file, compile time is now 10000ms (10 seconds). I have checked the event viewer for anything that is happening when VS is open but not when it's closed, used procmon and filemon to look for file access and checked to see if VS is enabling any services when it is open, all without success/impact. I have even tried uninstalling and reinstalling VS, this solved the problem for the first few builds but it then reoccurred. Restarting the machine has no effect. I have no plugins installed in VS. My colleagues machines do not display this problem and they have the same setup. This is all running on a machine with 16gb ram, 64-bit win 7 and SSD. Anyone got any clues?

Original source