views:

793

answers:

2

In attempting to use the Performance Tools on an ASP.NET website I'm getting various combinations of these errors (depending on what I attempt to do to fix them):

  1. The web site could not be configured correctly. Configuring '\web.config' failed. Access to the path '\web.config' is denied. - I can make this dissappear by checking-out the web.config file or unsetting the read only attribute
  2. The web.config file for the site http://localhost:0/ contains information from a previous run. The web.config file was generated, so deleting it should fix the issue. - Why is it using port 0? I can't find this setting anywhere. A 'normal' run uses a specified port, e.g. 4549
  3. The web.config file \web.config has been changed and backup information was lost. - What?!

Any ideas?

I'm running Visual Studio 2005 with TFS 2005, it's an ASP.NET 2.0 Web Application Project.

+1  A: 

I found a solution to the above errors which allows me to use the sampling profile method but there is another, possibly unrelated problem when I try to use the instrumentation profile method.

As in the original question - just check-out the Web.config or remove the read-only attribute, this fixes error 1.

To fix errors 2 and 3, remove the lines below from your Web.config:

<appSettings>
    <add key="microsoft.visualstudio.teamsystems.aspnetdevserver:/" value="3311;True;3204;1" />
    <add key="microsoft.visualstudio.teamsystems.backupinfo" value="1;web.config.backup" />
</appSettings>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    </assemblyBinding>
</runtime>
tjrobinson
A: 

I was getting "The web.config file for the site http://localhost:0/ contains information from a previous run. The web.config file was generated, so deleting it should fix the issue" in Visual Studio 2008 when I tried running a unit test for a web service method. I had a Web.config file in my web service's project directory, but that wasn't the one getting modified. Turns out, I had passed the wrong argument to AspNetDevelopmentServer and it was sticking web.config in other directories. Here are the two lines I had to put above my unit test method (in addition to [TestMethod], of course):

[AspNetDevelopmentServer("MyWebService", @"MyWebServiceProjectDirectory\")]
[UrlToTest("http://localhost/MyWebService/MyWebService.asmx")]

Now I can run the unit test fine. Before, it would run fine once, then give me that web.config error. Now, it runs fine multiple times without complaining about the web.config file.

Sarah Vessels