A Huge problem with my Visual Studio 2010
From Time to time my visual studio 2010 occupies the executable program in Debug subdirectory.
Thus I have to unload the solution and reload it. Then ReBuild it and then run it. The all situatuation becomes upseen I really can't work like that. I have already unclick in Debug sec开发者_Python百科tion theEnable the Virtual Studio hosting process
Is there any one to help me on this situation?Well this is a bit of a workaround but works for me most of the time. This doesn't solve the root cause but the symptoms (the file locking):
Add this as a pre-build event:
if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"
(Source of the solution: http://nayyeri.net/file-lock-issue-in-visual-studio-when-building-a-project)
Also here there is a similar problem and a liberal solution: Visual Studio 2010 build file lock issues
It may also not be Visual Studio locking your executable, check the locks on it with "Unlocker": http://www.emptyloop.com/unlocker/
When this happens I open Process Explorer and use the Find - Find Handle or Dll menu to find the process which has the file still open. From there I can jump the the handle in the process and close it from within Process Explorer. That works although it is a bit hacky.
Yours, Alois Kraus
精彩评论