As I recently discovered, your anti-virus real time protection can cause all sorts of issues with Visual Studio. This my guide on how to set up your environment for less hassles and the added side effect of a faster visual studio environment.

Exclude your project folders from real time protection

If you are super organised and keep all of you projects under a master folder then is an easy tip, otherwise you are going to need to add each project folder to your exclusion list in your Anti-Virus Software.
It’s okay to allow your scheduled virus scans to scan these folders, we just don’t want them being scanned when we are compiling our code.
Another alternative is to add .vb and .xml as file type exclusions from real time. Again leave them for scheduled scans

Other folders to exclude from real time protection

Add the following directories to your exclusion list:
C:\Program Files\MSBuild
C:\Program Files (x86)\MSBuild
C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv
C:\Program Files (x86)\Microsoft Visual Studio
C:\Program File\Microsoft Visual Studio ##.# //where ##.# is the version number you have installed (you may have more than one)
C:\Program Files (x86)\Microsoft Visual Studio ##.# //where ##.# is the version number you have installed (you may have more than one)
C:\Program Files (x86)\Reference Assemblies
C:\Program Files (x86)\Windows Kits
C:\Windows\assembly
C:\Windows\Microsoft.NET
C:\Windows\Prefetch
C:\Users\\AppData\Local\Temp

 

Just to be doubly sure I also exclude the following extensions:

.XAML
.xml
.vb
.ildll

Visual Studio Tweaks

If you are finding the XAML editor to be slow have a read of my blog post XAML Designer slows me down

If you’ve been doing heaps of work and visually studio is getting slower and slower try forcing a garbage collect.  Just hold down CTRL + SHIFT + ALT and press F12 twice

Also don’t forget to check out my Visual Studio Environment Set Up Tips post