I'm sorry I cannot seem to fix this error:
Severity Code Description Project File Line Suppression State Error CS2012 Cannot open 'C:\Users\Usuario\source\repos\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe' for writing -- 'Access to the path 'C:\Users\Usuario\source\repos\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe' is denied.' WindowsFormsApp1 C:\Users\Usuario\source\repos\WindowsFormsApp1\WindowsFormsApp1\CSC 1 Active
I suppose it has something to do with the file being read only? I tried changing it and it reverts to read only, I tried closing and reopening VS, I tried running it as an administrator, I changed the assembly name and default namespace and now it won't even run the debugger
I'm new to C#, I used to do Java and never had an error like this one, sorry if it's something very simple. By the way I'm using Windows 10 with Bitdefender installed
Had the same problem and fixed it with deleting obj
directory.
Hope it helps :)
This issue occurs because the dll file is open some where, suppose you try to delete the dll file from obj folder then also message appears that "The file is open in another program."
In my case, I close all VS instance and copy the root folder and paste it into another folder then open my solution in VS it works fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With