Windows Defender Real Time Protection Service slowing down Visual Studio etc

本秂侑毒 提交于 2021-02-18 20:59:42

问题


Since past two months or so I have been observing a strange phenomenon with the Real Time Protection Service that comes bundled in as a part of Windows Defender on Windows 10.

When this service is set to ON Visual Studio builds take an excruciatingly long time to complete. Visual Studio itself takes forever to launch. Further if there are managed add-ins (written using Visual Studio Tools For Office, VSTO) installed in Outlook, Outlook takes 13-14 seconds to launch! When this service is disabled Outlook again launches within two seconds or so.

I have raised this on Twitter with Windows Support and tried discussing this online with Microsoft Support for an hour without any resolution. Looking around the internet I can see there are users who are reporting same problems such as

http://ardalis.com/speed-up-visual-studio-build-times

Slow page refresh times during development

I have been noticing this for only two months or so. I have tried spinning up new VMs in Azure etc. to test this and in every instance I have noticed this Real TIme Protection Service to be the culprit. My main issue is the Outlook Add In load time to be honest.

I tried posting this on Microsoft answer's site here but so far no luck. I was hoping if anyone here knows how to get this resolved without adding exception for Outlook in Real Time Protection Service (after which the add-ins load as expected within 200 milliseconds).


回答1:


I had the same symptoms and my problem was fixed by disabling logs in Microsoft .Net Framework Assembly Binding Log Viewer (FUSLOGVW.exe). I forgot that I was running a test and left logging on.

  1. Run the viewer as administrator.
  2. Click Settings button.
  3. Check Log Disabled



回答2:


Try excluding Visual Studio related file types from Windows Defender like this person did for Delphi:

If you are cool with no protection at all you could disable Windows Defender, but I wouldn't recommend it.




回答3:


Another answer to this problem, rather than excluding certain file extensions from Real Tme Scanning, is to exclude certain directories. Then you can exclude your Delphi/Visual Studio/Eclipse workspace.

I also found that certain apps during development make heavy use of the tmp dir. You can create a specific temp dir for your dev work and then configure your IDE/dev tools to use that temp dir instead of the system one, and then exclude that temp dir from real-time scanning.




回答4:


Here are two links to fix performance issues caused by Real-Time scanning, by excluding VS processes and Folders, thus improving the performance of VS in general but especially when Building.

1- Ready PowerShell script: Adds Windows Defender exclusions for Visual Studio 2019 by Ryan-Efendy

PS: by default executing scripts is disabled, just enable before executing, and disable after executing

Set-ExecutionPolicy unrestricted
run command
Set-ExecutionPolicy restricted

2- Same but you have to do the steps manually.

Tweaking the environment to speed up Visual Studio by Burak Tasci



来源:https://stackoverflow.com/questions/36834004/windows-defender-real-time-protection-service-slowing-down-visual-studio-etc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!