13

We are using Visual Studio 2008 as our primary development IDE. Our security team has set up McAfee to scan files in our \Local Settings\Temp folder. Unfortunately VS uses this directory during code builds which is slowing the developers down. We've reached an impasse with the security team on this, and wonder if anyone knows of a configuration setting in VS where we could change the folder to where those temporary files are written.

Thanks

Argalatyr
  • 4,639
  • 3
  • 36
  • 62
DAC
  • 131
  • 1
  • 3
  • I have a hard time believing that virus scanning is slowing down your build times, unless you're getting some false positives. – Joel Coehoorn Oct 08 '08 at 14:47
  • 8
    @Joel: *really*? Have you ever benchmarked C++ build times with and without an active (scans each file on open) virus scanner? I have. It's brutal. On my old, single-core machine, it almost doubled build times. And McAfee is one of the worst. – Shog9 Oct 08 '08 at 14:52
  • I've never had an issue with it. But then you've both mentioned McAfee. I suppose it might have some quirk that causes a problem. In that case you have more success lobbying for a _different_ scanner rather than no scanner. – Joel Coehoorn Oct 08 '08 at 14:54
  • 2
    Well, it boils down to being a problem with active scanners - since VS creates a lot of temporary files, the scanner is continually stepping in and delaying access to them while it scans - it's constant overhead. I can't imagine *wanting* a scanner on a dev machine. – Shog9 Oct 08 '08 at 15:00
  • some virus scanning scan ALL filess looking for ALL types of virues EVERY time the file is opened. (Others just can dll and exe when the are loaded into ram.) I have need this problem before, it make builds take at least 10 times longer. However on different PC and/or virus scanners and/or project it was not a problem. – Ian Ringrose Aug 20 '09 at 12:01
  • see also http://stackoverflow.com/questions/1305709/slowdown-of-microsoft-visual-studio-due-to-different-virus-scanner – Ian Ringrose Sep 18 '09 at 10:41
  • @Joel Coehoorn - https://kc.mcafee.com/corporate/index?page=content&id=KB59831 – Mark Ingram Mar 17 '11 at 15:33

5 Answers5

5

You can write a batch file which overwrites the %TEMP% and %TMP% variables and then launches visual studio. When the batch file overwrites an enviorment variables it is applicable only for that session, it does not modify the %TEMP% for applications launched from other batch files / system directly.

5

Use the tempDirectory property of the compilation section in your web.config:

<compilation debug="true" tempDirectory="C:\Foo">

Make sure you give the ASPNET account write access to C:\Foo (or whichever account your ASP.NET worker process is running under - in my case it's a domain account).

As per: http://msdn.microsoft.com/en-us/library/system.web.configuration.compilationsection.tempdirectory.aspx

Cory Grimster
  • 1,606
  • 1
  • 12
  • 12
  • 2
    Changes to web.config will affect runtime performance - the OP is talking about speed of compilation in Visual Studio: compile time, not run time. – Bevan May 30 '11 at 22:24
3

If you are able to debug processes on the box then attaching a debugger to the virus scanner and forgetting to let it run after hitting the attach breakpoint would improve performance.

Rob Walker
  • 46,588
  • 15
  • 99
  • 136
0

Maybe complain a lot that you need faster computers since the added security slows you down so much? Have hard facts ready (like "slower compile time costs me 60 minutes every day")
Usually when it comes around to spending money most businesses find other ways around a problem.

Sam
  • 28,421
  • 49
  • 167
  • 247
0

At my company, we go into the Services screen and set the on-access scanner to "disabled", which prevents it from starting at system boot (except when they push out an update, then you have to do it again). It's worth noting that you can temporarily disable it by clicking "stop", but it will periodically restart itself. Setting it to "disabled" prevents it from restarting. Improves performance 10X. To mitigate the risks of viruses, we are very vigilant about doing a full system scan periodically.

If you must live with the on-access scanner, I don't think a faster computer is what you need to ask for. In my experience, it's always the disk being accessed that's the bottleneck. Ask for solid-state disks and/or a striped RAID configuration. Of course, a few more cores never hurt anyone... especially with that much disk throughput, it might become necessary. but then you'd need more disk throughput. etc.

rmeador
  • 25,504
  • 18
  • 62
  • 103