2

So I'm having an intense amount of trouble trying to debug a wcf service, and could use some help. The service I'm writing is in C#, Visual Studio 2010, and is part of an existing service my company has in one of our client's projects. I'm using WCFTestClient to connect to the service when i debug it locally. Whenever I first open up visual studio and debug the service in question it works fine, but if I make changes to the code and need to rebuild, I'm getting the following error:

Unable to copy file "obj\Debug\Application.DataAccess.dll" to "bin\Debug\Application.DataAccess.dll". The requested operation cannot be performed on a file with a user-mapped section open.

The only way I've been able to work around this issue is to close visual studio and reopen it, which is rather time consuming and annoying to do every time I make a change. I've tried cleaning the solution and rebuilding, but I get the same error. I've even opened up Process Explorer to try and find what's using the dll, but the only thing is FxCopCmd.exe which is part of visual studio.

Does anyone have a better way of debugging wcf services locally, or have an idea of how to prevent or resolve the above error? Any help is greatly appreciated, thanks.

Pratik
  • 607
  • 4
  • 4
Dodecadaemon
  • 103
  • 1
  • 8
  • Have you tried close the "ASP.NET development Port" and the WCFHost before rebuild your application? – GuFigueiredo Mar 07 '13 at 20:34
  • I have stopped all the development ports, the application calls a few, but that doesn't seem to help. I'm not seeing a WCFHost process, devenv.exe and FxCopCmd.exe are all that are attached to the dll. – Dodecadaemon Mar 07 '13 at 20:55
  • @EliteSniper177 Wild guess, but could there be a `rights` issue with the folder? – Silvermind Mar 07 '13 at 21:41
  • @Silvermind I tried playing with the folder permissions, but that doesn't seem to have any effect – Dodecadaemon Mar 08 '13 at 19:53

3 Answers3

1

I was having the same problem (FxCopCmd.exe locking some DLLs) and I found out that people using this extension "Visual Studio Achievements For VS2010" were also experiencing similar issues (see the comments on this page).

Removing this extension from Visual Studio solved the problem for me.

Gyum Fox
  • 3,287
  • 2
  • 41
  • 71
1

Go to the Windows folder of solution location and delete all bin / obj / debug DLL's manually rather than cleaning the solution. Should work then (had same issue at my end when I took latest of existing WCF from TFS and while building it gave me error)

Rohit
  • 145
  • 2
  • 11
0

As stated here: The requested operation cannot be performed error when compiling an XNA project

Closing project settings file solved the problem for me.

Community
  • 1
  • 1
Valentin Kuzub
  • 11,703
  • 7
  • 56
  • 93