Help with solving error

Hi,

When attempting to run my application I receive the following 2 errors. How do I fix those two errors?

1. Could not copy "obj\x86\Debug\AP29_XMLA.exe" to "bin\Debug\AP29_XMLA.exe". Exceeded retry count of 10.

2. Unable to copy file "obj\x86\Debug\AP29_XMLA.exe" to "bin\Debug\AP29_XMLA.exe". The process cannot access the file 'bin\Debug\AP29_XMLA.exe' because it is being used by another process.      AP29_XML

thanks,

Victor
vcharlesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
Sounds like the file AP29_XMLA.exe is executing (or opened by another app) so you can't overwrite it.  Check the task manager and close the exe down then try again.
AndyAinscowFreelance programmer / ConsultantCommented:
ps.  A reboot should also cure it.
Fernando SotoRetiredCommented:
Hi Victor;

This could also happen if in your code you open a file then you quit the application in the middle of debugging and that leaves the file in use. So when you run your application again you can't access the file because it is being held by another process. Every time you run your app it starts a new process and the cause of the error.

By the way if you terminate Visual Studio and restart it, it will work again until you hit the problem again. Place code like that in a using statement and make sure you are not in that block when you terminate the debug session.
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

vcharlesAuthor Commented:
Hi Fernando,

I will try it, noticed if zi rename the assembly and rootname thr the error fors noy occur. According to task manager there are no other instances running.

Victor
Fernando SotoRetiredCommented:
According to task manager there are no other instances running.
And yet the OS see one.
vcharlesAuthor Commented:
Yes, that is very strange.
AndyAinscowFreelance programmer / ConsultantCommented:
Leave the names the same.  Reboot.  Does the error still happen?
vcharlesAuthor Commented:
I will try it later and get back to you.
AndyAinscowFreelance programmer / ConsultantCommented:
I've also remembered something from many years ago.  For a few weeks I experienced intermittantly a similar problem.  Turning the AntiVirus off temporarily and the problem disappeared.  Turn it back on and occasionally I would see this sort of error.  A couple of weeks later everything worked perfectly again.  
That certainly looked like a buggy update to the anti virus app was causing it.
Fernando SotoRetiredCommented:
Hi Victor;

It has been my experience that this issue can be corrected by saving and closing the project closing down Visual Studios and then starting Visual Studios back up and reopening your project. Having this issue I have never needed to reboot the machine to get the project working again.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vcharlesAuthor Commented:
Thank you for all the comments.

Victor
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.