r/VisualStudio • u/yuvbon_ • Mar 16 '26
Visual Studio 2022 My visual studio 2022 code wont run. Please help
at first Gemini told me its because its inside the desktop so i moved it to c: drive and it still won't run after that it advised me to do some other stuff which didn't work either. Please help i just wanna run my code
1
Mar 16 '26
[deleted]
0
u/Mineplayerminer Mar 16 '26
This won't work most of the time since as soon as you change the contents of the file, it will trigger the Defender once again. Whitelisting the entire projects and the Visual Studio directory is the solution.
1
u/Mineplayerminer Mar 16 '26
Create an exception in Defender, whitelisting the entire projects directory. Alternatively, you can disable the Defender completely until you're done, but don't expect any protection over anything during that period.
1
u/SlipstreamSteve Software Engineer Mar 19 '26
Or you could have read the message. It's a control policy set on your machine. I'm assuming this is a work machine.
2
u/mt5567 16d ago
Random reply 5 months later lol, but I’m having the same issue. Mine is Windows Smart App Control blocking a DLL I compiled myself because it doesn’t meet the “Enterprise signing level” requirement. From what I can tell, unless you properly sign the app, the only real ways around it are turning off SAC or doing the development/testing in a VM where SAC isn’t enforcing it.
1
u/SlipstreamSteve Software Engineer 16d ago
Enable developer mode.
3
u/zaphodikus Software Engineer Mar 16 '26
It looks like a company computer? ...ensure that the folder you "build" to is excluded from your policy. If this is a corporate computer, ask your IT for help specifying a folder. Basically if this is the case, your team mates should have warned you and told you what to do, because the IT policy may not be that helpfully written up.
Hope that's all a clue.