Unable to attach to application “WebDev.Websever.EXE”

24 04 2009

Had this problem the other day when trying to debug an ASP.NET web application, after hitting F5, a message box pops up saying “Unable to attach to application ‘WebDev.Webserver.EXE’ (PID:xxxxx) using {my machine name}”.

Had me for a while, untill I decide to disable my AV software at which point it starts to work again. So I then add the VS directories as exclusions to the AV software, re-enable it and problem solved.





Debugging .NET Serialization Code

25 02 2008

Just what is your XmlSerializer doing?

You can find out by debugging the serialization code which is generated automatically at runtime;

1. Modify your .config file to include the following snippet

<configuration>
   <system.diagnostics>
      <switches>
         <add name="XmlSerialization.Compilation" value="1" />
      </switches>
   </system.diagnostics>
</configuration>

2. Rebuild your code and set a breakpoint on or just after where you create an instance of the XmlSerializer, but before you call Serialize() or Deserialize().

3. Navigate to the temp directory in your profiles local settings directory

For Vista this is [C:\Users\{user}\AppDataLocalTemp]

For Win XP+ this is [C:\Documents and Settings\{user}\Local Settings\Temp]

4. In Visual Studio, open the most recent .cs file from this folder, set a break point and away you go.
 

Technorati Tags: ,,,,




Unable to run tests in VS 2008 Unit Testing

11 12 2007

Had a problem today trying to run tests in Visual Studio 2008, where the test run would complete saying that all tests were not executed. A look in the test run details shoed the following error message;

“Code coverage collection error: The Visual Studio performance and coverage logging engine is already running on the computer. Therefore, the test run cannot continue. Close the pending performance or code coverage session and then rerun the tests.”

The solution is to shutdown the VSPerfMon.Exe process which gets left in memory when you debug a unit test and stop the debugger before the test finishes.

More information can be found here at Microsoft Connect.