Monday, December 13, 2010

Using macros in Visual Studio to rename files and classes

Recently I was working on a project that was initially started back in 2005. The solution is divided in several layers: entity layer, business layer, data layer and UI. For the first three layers CodeSmith is used to generate base classes based on the database schema. Extra functionality is added by implementing derived classes. Every database change or new common functionality can be added for all classes by changing a CodeSmith template. Very handy if there are more than 100 objects per layer.

Friday, August 6, 2010

log4net ColoredConsoleAppender: log levels and its problems

I was playing around with the ColoredConsoleAppender of log4net. It allows you to display a certain log level in another color. For instance messages with an error level can be displayed red in the console. But I encountered some problems with it.

Thursday, July 1, 2010

Making log4net run on .NET 4.0

I was playing around with .NET 4.0 and wanted to include logging. So I downloaded log4net (v1.2.10) and added the source project to my solution. The next thing to do was to configure log4net and I would be able to log to one or several 'appenders'. At least, that was what I thought! How to configure and use log4net is not the scope of this article, but you can find all what you need on the log4net site. A summary of the solution can be found at the bottom of this article.