I can't seem to run a simple console application that just prints out "Hello World" and then a Readline() to end the program.
NB, this happens only on my work PC. I don't have this problem on my personal PC.
I explain what I have done.
Visual Studio: Community 2022 (64-bit) - Version 17.8.5
OS: Windows 11 Business Version 10.0.22631
In Visual Studio, when I run the project I get the following error:
Error while trying to run project: Unable to start program [PATH TO EXE FILE]
Access is denied
I then open the project folder in Windows Explorer and manually run the exe file in the Debug folder. I get a similar error message with slight different wording that says:
Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.
It seems like there is a user rights problem. I open the security properties of the containing folder and notice that my user is mentioned and it has Full Control authority over the folder.
Mind that in my Windows Security settings, I have also tried deactivating the Reputation-based Protection to allow running unrecognized apps and files. Althrough, this is not recommended, but I have done it just to see if it makes any difference.
As I said, none of this is required in my personal PC where I run the exact same program. I am running out of ideas where to look.




The likely cause is:
See Event Viewer -> Application and service logs ->
/Microsoft/Windows/Windows Defender/OperationalIn my case, I see events that indicate threat protection is the cause.
Here is the copilot translation of my french error message from eventvwr:
Original French event: