Visual Studio 2008 Internal Web Server stopped working in Vista


I have been debugging perfectly fine using Visual Studio 2008 using visual studio internal web server, but suddenly today it stopped working (maybe due to windows update, but still not sure about the cause of this suddenly not working), On starting the debugger IE came up with a blank page saying the page could not be opened, same happened in firefox when I tried to use that for debugging, It took me sometime to realize that this was due to a vista Issue, IPv6 gets installed with Vista and cannot be un-installed or disabled easily, and that creates the problem. I followed this post to sort out my issue.

The main action that sorted this out for me was to edit the hosts file in C:\Windows\System32\drivers\etc

and change the localhost entry from

::1             localhost

to

:::1             localhost

one more Collen.

So if you are having this issue as well, do not pull your hair out but follow the post linked above or change your host file entry for localhost as explained above.

Using NUnit with Visual Studio 2008 Class Library


Class library are a bit harder to debug compared to dialog based or command line based application. After deciding to use NUnit I was using a dialog based application to instentiate my class library debugging, however there is a much easier way of doing that

1) Create class library with unit tests

2) Take properties of the class project in visual studio, and select the debug tab. properties -> debug

3)  Set Start external program to C:\Program Files\NUnit 2.4.1\bin\nunit.exe or whereever you nunit executable is placed.

4) Set the test library as startup project.

5) Start debugging the project, it will bring up the nunit test application, if there are breakpoints in the application it will break into it.