4

After launching the performance wizard, selecting Instrumentation, choosing one web project and a few C# library projects, and enabling Tier Interaction Profiling, I get this weird leading off with:

Restoring the configuration file failed. File '...\web.config.backup.3b2912c9-3849-2724-8317-1a7da3819869' could not be copied to '...web.config'. The process cannot access the file '...\web.config' because it is being used by another process.

I should also add that the web application in question is hosted in IIS. Any thoughts?

James Alexander
  • 6,132
  • 10
  • 42
  • 56
  • Have you opened your web.config in another editor? – Dima Pasko Nov 30 '11 at 20:06
  • Yes, I've verified the file isn't locked in any way. – James Alexander Nov 30 '11 at 20:46
  • Weird permissions on the file maybe? Allow full access to everyone temporarily to check? – rrrr-o Dec 06 '11 at 15:21
  • I read some posts about similar problem; can be an antivirus blocking control? Tried clean/build your project? Can you check who is using web.config with "Process Explorer" (SysInternals)? Can this help you http://stackoverflow.com/questions/1121386/unable-to-copy-file-reference-dll-to-bin-reference-dll-the-process-cannot-acces? – Irvin Dominin Dec 11 '11 at 14:52
  • Did you ever solve it? I have the same problem and non of the answers below is a solution for me :( – Martin Bring Sep 19 '14 at 11:27

3 Answers3

1

Had the same. what I did is to find who's holding my files (did it using the "process explorer" from SysInternal). you need to use the "Find Handle Or DLL" - shortcut CTRL+F and put the address and it will find the relevant processes.

The handle that hold my file was the process "Windows Event Collector Service" so I killed it and all came back to normal.

Tamir
  • 3,833
  • 3
  • 32
  • 41
0

I encountered this while working with VS2012, but discovered it was AppFabric on my local development machine that was holding the web.config hostage.

I disabled and stopped the Services on my local box and everything was back to normal.

Hillbilly Coder
  • 1,171
  • 1
  • 10
  • 12
0

I've had something similar with web.configs. You say it's hosted using IIS, is the web.config actually in the wwwroot (or sub directory of that)?

And I guess you are using Windows 7/Server 2008?

Its UAC if so.

You can turn of User Account Control, or run whatever application it is as administrator, even if you 'are the administrator'.

Or just copy [do not move!] the files to your 'my documents', do whatever with them, then put them back.

Either way, I would try the upgrade with a copy of the files in your 'my documents' folder to ensure you have all the privileges you need.

Good luck.

adudley
  • 902
  • 10
  • 24