Hello everyone I am new to mono game and am trying to create a 2d platformer. Everytim I try and run the debugger on my PC I get this error.
error CS2012: Cannot open ‘C:\Users\sean\documents\visual studio 2015\Projects\Game3\Game3\obj\x86\Debug\Game3.exe’ for writing – ‘Access to the path ‘C:\Users\sean\documents\visual studio 2015\Projects\Game3\Game3\obj\x86\Debug\Game3.exe’ is denied.’
I think access is denied, because windows has it marked as “in use”… Its not just that you cant overwrite your exe file from within VS, you also cannot manually delete it in its folder!
Maybe the last debug run wasn’t terminated correctly and the task is still running. That’s why the OS doesn’t let you compile (=write) the file.
You have to open Task manager and kill the old process. Or reboot.
Why is it trying to run the executable from the obj folder? I think you might have the output directory set to obj instead of the default bin. Obj is the default directory for the intermediate files, so it is trying to copy or write a file to itself when trying to move it to the output directory.