Rico Suter's blog.
 

Articles

My most used Visual Studio and ReSharper extensions

This article describes some of the Visual Studio and ReSharper extensions and development tools I’m using to enhance my daily C#/.NET development productivity.
Read More ›

Cheat Sheet: Best practices for writing XML documentation in C#

The XML documentation tags of C# are described very well in the MSDN. However, the article does not explain how the contained phrases and sentences should be written. This article tries to fill this gap by providing rules and some sample phrases.
Read More ›

How to implement and register a custom dependency resolver in ASP.NET MVC 5

The ASP.NET MVC 5 framework supports the integration of 3rd party dependency injection frameworks. This can be done by implementing the IDependencyResolver interface and registering an instance of the interface on application startup. The registration is made in the Application_Start method which can be found in the Global.asax.cs file:
Read More ›

Elegant method parameter validation with Code Contracts support

Each C# developer knows the drill: Each method parameter has to be validated against null values, wrong value ranges or other contract constraints. When also validating using Code Contracts, the resulting code may take up most of the method body:
Read More ›

A transparent undo/redo mechanism for XAML applications

In one of my recent projects, I had to implement an undo/redo mechanism for an observable object graph. The usual approach to this problem is to implement commands which operate on the object graph and provide Do() and Undo() methods. The problem was, that a great portion of the business logic was already implemented and was not command-based. This is why I had to find a solution which works transparently on the property change events of an object graph whose objects implement the INotifyCollectionChanged interface and use the ObservableCollection class for collection properties.
Read More ›

Recommendations and best practices for implementing MVVM and XAML/.NET applications

In this article I’ll describe the rules and practices I’m following for XAML and MVVM application development. I’m using the described techniques since multiple years and they have proven themselves for me. Most of the described rules apply for all types of XAML projects – Windows Store, Windows Phone, Silverlight and WPF projects.
Read More ›

How to mimic singlecast events in C#

C# only supports multicast events and delegates. Even if you define a delegate property without the event keyword, it still remains multicasted:
Read More ›

Implementation of “hybrid” (console or GUI) .NET applicatios

Have you ever had the need to use an application (.exe) as a command line tool when started in the console (cmd.exe) and as GUI application when started from the Explorer shell? This article explains a possible implementation for this requirement.
Read More ›

The correct handling of a WCF client’s life cycle

The most intuitive way of handling a generated WCF client’s life cycle is by putting it into a using block:
Read More ›

How to create an MSI installer using the WiX toolset

This article provides a simple guide about how to quickly create a WiX installer project for an existing WPF application or another Windows desktop application.
Read More ›