2
votes

I got a Windows Phone 7 application project from a friend. Now I downloaded the SdK 7.1 from here. Everything installed fine and it includes Expression Blend 4 as well as VS 2010 Express for Windows Phone.

Now the problem is that when I Run this project, I keep getting this error:

Unable to copy file "obj\Debug\MyProject.dll" to "\Bin\Debug\MyProject.dll". The process cannot access the file '\Bin\Debug\MyProject.dll" because it is being used by another process.

To make it run I have to close the Expression Blend and delete Bin and obj folders and then it will happily run.

I looked around the web but couldn't find any soultion that resolves this issue. My friend who has written this application has no issue on his machine. (And same issue is with Visual Studio 2010 Express for Windows Phone. I take this VS thing back, looks like it is working today with VS2010.)

I uninstalled everything and re-installed two times but no luck. Any ideas anyone??

2
you run the project on which one? visual studio or blend?Justin XL
@Xin: I have tried in both. VS was throwing error yest but not today. With Blend I have to delete Bin and obj folder and then it will run once. Also I made two separate copy for each Tool to see if one was interferring with another but no, I wasn't able to make it work on Blend.oms
i sometimes have this problem because i have the project running with Visual Studio and then i try to run it using Blend, then i just need to stop dubugging Visual Studio and the problem goes away, but i am not sure if this is your problem though...Justin XL
@Xin: I was thinking the same and so I just loaded the project in Blend from a separate location. Also after reinstalling everything, I didn't open my project in VS at all and just blend. So doesn't look it's the problem.oms

2 Answers

2
votes

I got it working but don't know exactly the problem except my guess is it could be some permissions issue but not sure what.

I created a brand new project and placed it under C:\Users\me\Documents\Expression\Blend 4\Projects Which is the default location. Then added all the files to it via Blend. Added the required references and it started working.

So it got me thinking if it was the location issue.

I had my project under C:\Windows Phone 7\MyProject\MyProject.csproj I moved that to C:\Users\me\Documents\Expression\Blend 4\Projects\MyProject and it works as normal.

I had already checked the permissions on folder to ensure it wasn't the issue and I am the administrator and also run the Blend as administrator.

So I don't know what the issue was but it works now after changing the project location.

Update:

I tried different variations but still didn't find exact problem but here are my tries.

These works:

C:\MyProjects\MyProjSolution\MyProject\MyProject.csproj

C:\MyProjects\Blendprojects\MyProject\MyProject.csproj

C:\WindowsPhone7\MyProject\MyProject.csproj (note I removed spaces from directory name "Windows Phone 7"

This doesn't work for some reason: C:\WindowsPhone7\Blendprojects\MyProject\MyProject.csproj

In any case, I am done with this error.

0
votes

For this first open your project in Visual Studio for Windows Phone. Then Go to Solution Explorer and then right click on MainPage.xaml and click on "Open In Expression Blend".