This is a known - and very annoying! - problem with Visual Studio, where running the project with a designer open intermittently locks the output file.
This StackOverflow question[
^] from 2010 references a (now deleted) blog post from 2006 regarding this issue.
There are various suggestions in that thread to work around the problem using the project's build events. I have yet to see an official "fix" for the problem, although it doesn't seem to happen as much in recent version of VS.