Defender blocking Visual Studio executables

Copper Contributor

I need some assistance regarding our Visual Studio projects being blocked with an access denied error. I originally posted this issue in the Microsoft Visual Studio Developer Community forums (https://developercommunity.visualstudio.com/t/VS-2022-Community-access-denied-error-wh/10108969#T-ND...) and the MSFT member who was assisting me concluded that it is a Defender issue.

 

Most of the time when we try to run a simple Visual Studio Windows Forms App (.NET framework) project build, we end up with the error: ‘C:\users\username\source\repos\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe’ - Access is denied. On a rare occasion the program will run properly without the error, but most of the time when students and teachers are trying to run their projects they fail with the access denied error. We are running Visual Studio 2022 Community on Windows 11 desktops in a Hybrid AD environment. 

 

As suggested by the MSFT member who was assisting me, I added the source folder to the Excluded Folders in Windows Defender Threat Protection through Group Policy, but it made no difference.

 

Thanks for any help that can be provided.

1 Reply
Can you check if there are any logs around the time the application was blocked?
They are available in the "Applications and Services Logs/Microsoft/Windows/Windows Defender/Operational" folder in Event Viewer locally on the device.

All block events should present as warnings or errors.

If you have Defender for Endpoint, blocks should show up in the Action Center of Microsoft 365 Defender as well.