VS 2005 IDE/Compile bug

C

c0r

VS only locks one version of the file, and you CAN rename/move it.
You can use the following commands in the pre-build event of the
problem-project to workaround the problem:

if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if not exist "$(TargetPath).locked" move "$(TargetPath)"
"$(TargetPath).locked"

Rene schreef:
Well, the Microsoft engineer just gave me some instructions on how to setup
my computer so that it can be monitored to find what is causing the problem.
Not sure how long this is going to take but I will keep posting.



You never told me if you could provide Microsoft your project so they can
troubleshoot what's going on, this may help the speedup the process.


MAF said:
We created the project from 2003, and then upgraded to 2005. I have tried
to use the unlocker utility that people have mentioned on other threads
but not to any success.

Rene said:
Is OK if you can't pinpoint the problem, but is it reproducible at your
will? Also, is this a project created with VS 2005 from scratch? Or did
you upgrade it from 2003?


I could never pin point the problem. Were you ever able to resolve this
issue?


Do you have a project with the problem that you would be willing to
share with the Microsoft engineer?



I am getting the same errors. Rearranging the projects might fix it
but that does not explain why the compile will work some times and not
others. If the order of the projects is invalid it shoud fail
everytime, correct?

I also tried the unlocker with no success. Does anyone have an answer
on how to get around this?


I am currently working with a Microsoft engineer trying to solve this
problem. It's been around 2 weeks and they are still trying to find
what is the cause of this problem is. They are currently escalating
the issue because the problem does not seem to have a straight answer.

Do you have a project that has the problem that you would be willing
to give to the Microsoft engineer? If you do, let me know so I can
put you in touch with the engineer and he can try to reproduce the
problem in his PC and try to narrow down the problem.

Thanks.


message Has anyone found a solution to this problem?


Frans Bouma [C# MVP] wrote:
Rene wrote:

I am sure that I am closing the application completely. It is the
Visual Studio IDE itself what is not releasing the file. This is
evident because things go back to normal when I close VS 2005 and
reopen it again.

I have been working on this project for around 2 years using VS
2003
and never had this problem happened until I started using VS
2005.

I can see my "Stop Debugging" Toolbar button (Shift + F5)
disabled as
an indication that nothing is running but I continue to get this
error. Perhaps there is some other process in the VS 2005 IDE
that
keeps holding on to the file after I stop debugging but I have no
idea what is that process.

The file name is not "xyz" but is also not a system or VS
specific
file, is one of my own. I have even deleted this file hoping that
VS
would recreate the file and snap out of the problem but
eventually it
display the error message again.

Also, a virusscanner can lock the file or windows' Indexing
service.
Be sure both aren't looking in your bin folders. This happens
because
as soon as the file is written, these services get a signal and get
into gear, grab the file and vs.net can't reference it right after
that
when it compiles a project referencing that dll just written.

FB




You're getting this error because of just what it says...the
dll is
in use by another application. Make sure that you are closing
the
application that you've compiled and run last to make sure that
the
file isn't still being accessed. Could you also please include
the
real name of the dll file that you're access...I'm guessing
it's
not really xyz.dll...that might help us figure out what
processes
might be using the dll...

Chris

--
Securing your systems is much like fighting off disease -- as
long
as you maintain basic hygiene, you're likely to be okay, but
you'll
never be invulnerable.

Steve Shah - Unix Systems Network Administrator
I keep getting the following error every time I compile the
solution under VS 2005:

----------------
Error 5

Unable to copy file "obj\Debug\xyz.dll" to
"bin\Debug\xyz.dll".
The >> process cannot access the file 'bin\Debug\xyz.dll' because
it
is being >> used by another process.
----------------


In order to get rid of this problem, I have to constantly
close
and >> restart VS 2005. Is anybody else getting the same problem?


--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET:
http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
 
M

MAF

Sorry I have not being able to create a sample project that will cause the
problem.

Rene said:
Well, the Microsoft engineer just gave me some instructions on how to
setup my computer so that it can be monitored to find what is causing the
problem. Not sure how long this is going to take but I will keep posting.



You never told me if you could provide Microsoft your project so they can
troubleshoot what's going on, this may help the speedup the process.


MAF said:
We created the project from 2003, and then upgraded to 2005. I have tried
to use the unlocker utility that people have mentioned on other threads
but not to any success.

Rene said:
Is OK if you can't pinpoint the problem, but is it reproducible at your
will? Also, is this a project created with VS 2005 from scratch? Or did
you upgrade it from 2003?


I could never pin point the problem. Were you ever able to resolve this
issue?


Do you have a project with the problem that you would be willing to
share with the Microsoft engineer?



I am getting the same errors. Rearranging the projects might fix it
but that does not explain why the compile will work some times and not
others. If the order of the projects is invalid it shoud fail
everytime, correct?

I also tried the unlocker with no success. Does anyone have an
answer on how to get around this?


I am currently working with a Microsoft engineer trying to solve this
problem. It's been around 2 weeks and they are still trying to find
what is the cause of this problem is. They are currently escalating
the issue because the problem does not seem to have a straight
answer.

Do you have a project that has the problem that you would be willing
to give to the Microsoft engineer? If you do, let me know so I can
put you in touch with the engineer and he can try to reproduce the
problem in his PC and try to narrow down the problem.

Thanks.


message
Has anyone found a solution to this problem?


Frans Bouma [C# MVP] wrote:
Rene wrote:

I am sure that I am closing the application completely. It is
the
Visual Studio IDE itself what is not releasing the file. This is
evident because things go back to normal when I close VS 2005
and
reopen it again.

I have been working on this project for around 2 years using VS
2003
and never had this problem happened until I started using VS
2005.

I can see my "Stop Debugging" Toolbar button (Shift + F5)
disabled as
an indication that nothing is running but I continue to get this
error. Perhaps there is some other process in the VS 2005 IDE
that
keeps holding on to the file after I stop debugging but I have
no
idea what is that process.

The file name is not "xyz" but is also not a system or VS
specific
file, is one of my own. I have even deleted this file hoping
that VS
would recreate the file and snap out of the problem but
eventually it
display the error message again.

Also, a virusscanner can lock the file or windows' Indexing
service.
Be sure both aren't looking in your bin folders. This happens
because
as soon as the file is written, these services get a signal and
get
into gear, grab the file and vs.net can't reference it right after
that
when it compiles a project referencing that dll just written.

FB




You're getting this error because of just what it says...the
dll is
in use by another application. Make sure that you are closing
the
application that you've compiled and run last to make sure
that the
file isn't still being accessed. Could you also please
include the
real name of the dll file that you're access...I'm guessing
it's
not really xyz.dll...that might help us figure out what
processes
might be using the dll...

Chris

--
Securing your systems is much like fighting off disease -- as
long
as you maintain basic hygiene, you're likely to be okay, but
you'll
never be invulnerable.

Steve Shah - Unix Systems Network Administrator
I keep getting the following error every time I compile the
solution under VS 2005:

----------------
Error 5

Unable to copy file "obj\Debug\xyz.dll" to
"bin\Debug\xyz.dll".
The >> process cannot access the file 'bin\Debug\xyz.dll'
because it
is being >> used by another process.
----------------


In order to get rid of this problem, I have to constantly
close
and >> restart VS 2005. Is anybody else getting the same
problem?


--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET:
http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
 
R

Rene

Assuming that the file being locked is the following file:

C:\FileWithProblems.dll

Could you please post what *exactly* do I have to type on the pre-build
event text box? I am wondering if I am not typing the right string.

Thanks.



VS only locks one version of the file, and you CAN rename/move it.
You can use the following commands in the pre-build event of the
problem-project to workaround the problem:

if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if not exist "$(TargetPath).locked" move "$(TargetPath)"
"$(TargetPath).locked"

Rene schreef:
Well, the Microsoft engineer just gave me some instructions on how to
setup
my computer so that it can be monitored to find what is causing the
problem.
Not sure how long this is going to take but I will keep posting.



You never told me if you could provide Microsoft your project so they can
troubleshoot what's going on, this may help the speedup the process.


MAF said:
We created the project from 2003, and then upgraded to 2005. I have
tried
to use the unlocker utility that people have mentioned on other threads
but not to any success.

Is OK if you can't pinpoint the problem, but is it reproducible at
your
will? Also, is this a project created with VS 2005 from scratch? Or
did
you upgrade it from 2003?


I could never pin point the problem. Were you ever able to resolve
this
issue?


Do you have a project with the problem that you would be willing to
share with the Microsoft engineer?



I am getting the same errors. Rearranging the projects might fix it
but that does not explain why the compile will work some times and
not
others. If the order of the projects is invalid it shoud fail
everytime, correct?

I also tried the unlocker with no success. Does anyone have an
answer
on how to get around this?


I am currently working with a Microsoft engineer trying to solve
this
problem. It's been around 2 weeks and they are still trying to find
what is the cause of this problem is. They are currently escalating
the issue because the problem does not seem to have a straight
answer.

Do you have a project that has the problem that you would be
willing
to give to the Microsoft engineer? If you do, let me know so I can
put you in touch with the engineer and he can try to reproduce the
problem in his PC and try to narrow down the problem.

Thanks.


message
Has anyone found a solution to this problem?


Frans Bouma [C# MVP] wrote:
Rene wrote:

I am sure that I am closing the application completely. It is
the
Visual Studio IDE itself what is not releasing the file. This
is
evident because things go back to normal when I close VS 2005
and
reopen it again.

I have been working on this project for around 2 years using
VS
2003
and never had this problem happened until I started using VS
2005.

I can see my "Stop Debugging" Toolbar button (Shift + F5)
disabled as
an indication that nothing is running but I continue to get
this
error. Perhaps there is some other process in the VS 2005 IDE
that
keeps holding on to the file after I stop debugging but I have
no
idea what is that process.

The file name is not "xyz" but is also not a system or VS
specific
file, is one of my own. I have even deleted this file hoping
that
VS
would recreate the file and snap out of the problem but
eventually it
display the error message again.

Also, a virusscanner can lock the file or windows' Indexing
service.
Be sure both aren't looking in your bin folders. This happens
because
as soon as the file is written, these services get a signal and
get
into gear, grab the file and vs.net can't reference it right
after
that
when it compiles a project referencing that dll just written.

FB




You're getting this error because of just what it says...the
dll is
in use by another application. Make sure that you are
closing
the
application that you've compiled and run last to make sure
that
the
file isn't still being accessed. Could you also please
include
the
real name of the dll file that you're access...I'm guessing
it's
not really xyz.dll...that might help us figure out what
processes
might be using the dll...

Chris

--
Securing your systems is much like fighting off disease --
as
long
as you maintain basic hygiene, you're likely to be okay, but
you'll
never be invulnerable.

Steve Shah - Unix Systems Network Administrator
I keep getting the following error every time I compile
the
solution under VS 2005:

----------------
Error 5

Unable to copy file "obj\Debug\xyz.dll" to
"bin\Debug\xyz.dll".
The >> process cannot access the file 'bin\Debug\xyz.dll'
because
it
is being >> used by another process.
----------------


In order to get rid of this problem, I have to constantly
close
and >> restart VS 2005. Is anybody else getting the same
problem?


--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET:
http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
 
C

c0r

Type two lines,
Line one:
if exist "$(TargetPath).locked" del "$(TargetPath).locked"
Line two:
if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move
"$(TargetPath)" "$(TargetPath).locked"
 
M

markgroner

Hey, that worked! I've looked in a ton of forums and am really psyched
to have found that. I was experiencing it in a vs2003 upgraded to
vs2005 multi project winform vss connected behemoth and your pre-build
event worked like a charm with this issue. kudos
 
D

durayakar

Another Kudos from me...
The Pre-compile code solved my problem...

THANK YOU all in caps...

PS:

For anyone that cannot reproduce, I have a prety stable way of
re-creating this:

Create a solution
Create 4 class library projects LibA (Data), LibB (DAL) LibC (Business)
and LibD (Facade)
Create 1 Window control Library project ProjA (Common UserControls) and
1 Winforms application ProjB (Executable)
Reference LibA in all the other projects
Reference LibB in LibC
Reference LibC in LibD
Reference LibD in ProjA and ProjB
Reference ProjA in Proj B

This would be a common setup for a Data, DAL, Business, Facade,
CommonUsercontrols and winforms solution, if anyone is using that
approach anymore...

add a dataset in LibA
Add a component in each of the other Libraries, drag-drop this dataset
on them
Add a Usercontrol in ProjA, drop the dataset + and the component from
libD on the usercontrol
Add a winforms to ProjB
Drag-drop the usercontrol in ProjA to this form.
Drop a button, create a handler but do not place any code in it.
Put a breakpoint in the buttonclick event handler
Compile > Compiles successfully
run debug
Click the button
add some dummy code (use edit-and continue)
stop debugging

add more code in LibA component

Compile > Get the error

LibA gives the error
 
M

MAF

So what was the over all solution?
Another Kudos from me...
The Pre-compile code solved my problem...

THANK YOU all in caps...

PS:

For anyone that cannot reproduce, I have a prety stable way of
re-creating this:

Create a solution
Create 4 class library projects LibA (Data), LibB (DAL) LibC (Business)
and LibD (Facade)
Create 1 Window control Library project ProjA (Common UserControls) and
1 Winforms application ProjB (Executable)
Reference LibA in all the other projects
Reference LibB in LibC
Reference LibC in LibD
Reference LibD in ProjA and ProjB
Reference ProjA in Proj B

This would be a common setup for a Data, DAL, Business, Facade,
CommonUsercontrols and winforms solution, if anyone is using that
approach anymore...

add a dataset in LibA
Add a component in each of the other Libraries, drag-drop this dataset
on them
Add a Usercontrol in ProjA, drop the dataset + and the component from
libD on the usercontrol
Add a winforms to ProjB
Drag-drop the usercontrol in ProjA to this form.
Drop a button, create a handler but do not place any code in it.
Put a breakpoint in the buttonclick event handler
Compile > Compiles successfully
run debug
Click the button
add some dummy code (use edit-and continue)
stop debugging

add more code in LibA component

Compile > Get the error

LibA gives the error
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top