I also had exactly the same problem. In my case, it happens every time when pushing code to Github and pulling code from GitHub and running it with Visual Studio. Also I tried to open it from external hard disk, i got the same error. Moving folder to C:\ drive and Visual Studio repo folder did not solve the issue. After browsing in Google and stackoverflow, I found the root cause. The root cause is Windows Defender blocks the execution. Each time windows Defender thinks it malicious and blocks. Here the answer and I copied here in case of it disappears.
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.
I went through the answer and found out Windows defender blocking the execution. Here the image what I found in Event Viewer
.
My computer is managed by ICT team and I contacted them with proof of root cause.