PDA

Click to See Complete Forum and Search --> : VS2010 Pro - Unable to copy file "obj\Release\blah.exe" to "bin\Release\blah.exe"...


DragonQ
Apr 27th, 2010, 08:22 PM
...because it's being used by another process."

I almost always get this error whenever I try to build or run a program after making some changes to it in VS 2010. I've had one or two days where it's worked fine for ages but usually it happens every time a change is made. I'm forced to save, close VS 2010, reopen the project and build/run. If I try to manually delete the built exe in \bin\Release, Windows tells me that I can't because it's in use by VS 2010. If I close VS 2010 I can delete the file normally.

Some info:

- I did not and do not have this problem with VS 2008, with the same projects.
- I can't say if it happens for all of my projects but it certainly isn't limited to just one.
- I'm using Windows 7 Professional x64 and Visual Studio 2010 Professional.
- All of my programs are in VB.NET, usually targeting .NET 2.0 and a mixture of x86 and AnyCPU.
- The projects are not in system or otherwise protected folders (like C:\).
- The programs are not open (aside from the .vshost process) when I get these errors.

Does anyone have any idea why this is happening? Is this a known problem with VS 2010?

DragonQ
Apr 28th, 2010, 10:53 AM
Oh, and another problem I only get with VS 2010, which might be related: sometimes when I start one of my programs (maybe 5% of the time) I get these warnings:

"Could not find type 'MyProgram.TextEditFrame'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU."

"The variable 'pnlVisualStylesEnabler' is either undeclared or was never assigned." (frmMain.Designer.vb)

To fix this, I have to comment out the declaration of 'pnlVisualStylesEnabler' in my frmMain code in order to be able to view the form designer, then save, build and uncomment it again. Very strange.