Thursday 24 January 2008

Visual Studio 2008 - Project Creation Failed

I have recently installed Visual Studio 2008 QFE - it is useful if you want to look into .Net framework sources. You can find details on ScottGu's blog. But after that when I needed to create new project in VS2008 I always get Project creation failed error. What to do when it happens is described here.

Wednesday 16 January 2008

How to create unit tests for Windows services in Visual Studio 2005

I needed to write couple of unit tests but it also included to write unit tests for Windows service.

First of all I wanted to create NUnit tests but I do not know how to do that and what should I test. Solution for this was use Visual Studion integrated tests. I added Test project to my solution and after that I used wizard for creating new test classes. Visual Studio created skeletons for testing methods and I only implemented what was necesary to check in the test itself. One thing which is quite cool is that VS generated tests also for private methods. This can be accomplished by using reflection.

Other problem was after I implemented tests and wanted to run them. All tests failed. It was because there was no windows service configuration file. It was necessary to copy app.config from other project to the place where is project test dll (name has to be project_test.dll.config). I set project copy app.config everytime the test project is successfully built (as post build event).

Wednesday 2 January 2008

How to use Gmail as you SMTP server

Detail description can be found on the following link How to use Gmail as your SMTP server.