Sep 222012
 

With the changes to the UAC system in Windows 8, it seems that whenever you try to launch an non-elevated application from an elevated application, you get an error similar to: “Class not registered (Exception from HRESULT: 0×80040154 (REGDB_E_CLASSNOTREG)”.

The reason is that under Windows 8, even if you set UAC to the lowest setting, you don’t disable it completely.

In my case, I was trying to start an URL using the default browser from an elevated application. After a lot of digging around on stackoverflow.com and other blogs and websites, I’ve managed to build a solution that seems to be working.

Continue reading »

Aug 022011
 

Snoop A must have for any WPF developer As a WPF developer, I often find myself trying to debug the visual structure of my applications or to find out why something doesn’t work as expected. The Visual Studio debugger can help up to a certain point, but for runtime visual debugging it lacks the necessary features. Luckily, there is an awesome free tool that you can use for this – Snoop. The tool itself is very straightforward – you select your running application press a button and you can see the whole visual tree:

Continue reading »

Jul 282011
 

I find that with the extension support in VS2010, programmers don’t really have an excuse for not using tools to increase their productivity and to increase the overall quality of their work. I am a really lazy programmer, in the sense that I don’t’ like to do repetitive boring tasks. Extensions are one of the solutions to being a happy lazy programmer. The other one is writing quality code, but that’s another story. So here is a list of all Extensions that I use in day-to-day work

 My list of Visual Studio 2010 Extensions
Continue reading »

May 182011
 

When doing TDD or at least unit testing, it is necessary to know how much of your code is covered by tests and, more importantly, which code isn’t. Since we migrated to NUnit the integrated Visual Studio 2010 code coverage does not do the job anymore for us (although I’ve found several articles on how to enable it, for some reason I couldn’t get it running).

There are two tools that you can use instead – one of them is NCover, which is a great tool but not free. The other one is PartCover, which is a free code coverage tool. I’ve opted to go with the latter. The main problem with PartCover is the almost non-existent documentation. After several hours of trying out different combinations of options I finally got it running and it does it job really good.

Continue reading »

May 182011
 

 

One of our main requirements when performing the migration was to have the same level of integration with our Team Build system. This means that the build should run all tests and fail if any test fails. Also we should be able to see in the build log which tests have failed.

This step is the most complicated one so here is a quick breakdown of all the steps involved:

  1. Setting up the build server
  2. Changing the build template
  3. Add a new ForEach sequence to iterate through all test assemblies
  4. Add a sequence to run all tests in a single test assembly
  5. Invoke NUnit
  6. Publish NUnit results
  7. Mark the build as broken if not all tests pass
  8. Modify the workflow to support projects without a test settings file
  9. Check in the build template file.

Continue reading »

May 182011
 

 

I am working in a large WPF project that is in a continuous evolution. Initially when we started the project we didn’t have any kind of unit testing in mind, then later we switched to an (almost) TDD approach. Since we use TFS for source control and automated builds, the natural decision was to use MSUnit as the test framework. Although this approach has some benefits, after the project has grown in size we have reached several limitations.

Continue reading »

May 172011
 

 

I often work on various branches of the same project (using TFS). This means that I have folders setup like:

[root]/Project

[root]/Branch A/Project

[root]/Branch X/Project

Sometimes I have to keep multiple Visual Studio instances open at the same time with branches of the same project and because by default VS2010 only displays the solution name in the title bar, switching between different windows can become very confusing.

Continue reading »

May 112010
 

This is the third part of a series covering code generators in Visual Studio 2008. Part I and part II of this series cover how to create the project and all the necessary steps for writing a code generator.

The series is divided into four parts:

Part I  – creating a Visual Studio Package

Part II  – creating and registering a code generator

Part III (this one) – generating code & debugging

Part IV – creating the setup project and deploying the package

Continue reading »