Lefteris Gkinis
Lefteris Gkinis

Reputation: 1259

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 section the
Enable the Virtual Studio hosting process
Is there any one to help me on this situation?

Upvotes: 4

Views: 319

Answers (3)

Alois Kraus
Alois Kraus

Reputation: 13545

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

Upvotes: 0

Teoman Soygul
Teoman Soygul

Reputation: 25742

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

Upvotes: 3

tcables
tcables

Reputation: 1307

It may also not be Visual Studio locking your executable, check the locks on it with "Unlocker": http://www.emptyloop.com/unlocker/

Upvotes: 0

Related Questions