RoBlog – Refactoring Reality

Discrete thought packets on .Net, software development and the universe; transmitted by Rob Levine

Category Archives: .Net

UnityLog4Net extension now retired

by Rob Levine on 14-Jan-2018

As of Unity v5, there is now an official extension for using Log4Net with Unity. Consequently, UnityLog4NetExtension is now retired for Unity v5 and higher. Information on the official extension can be found here: https://github.com/unitycontainer/log4net The NuGet package is here: https://www.nuget.org/packages/Unity.log4net/

Using log4net with Unity (part 2) – UnityLog4NetExtension now on NuGet

by Rob Levine on 21-Dec-2013

Following on from a previous post, the solution detailed has now been renamed to “UnityLog4NetExtension” and is now available as a NuGet package as well as via GitHub. So if you want to dependency inject the correct log4net ILog logger instance for your type, all you need to do is: 1) reference the NuGet package […]

Unity does not respect HierarchicalLifetimeManager when manually registering UnityServiceLocator with the container

by Rob Levine on 15-Mar-2013

I’ve been trying to phase out some usage of the static ServiceLocator pattern in our codebase. There are many reasons not to like this, which I won’t go into here: 1 var foo = ServiceLocator.Current.GetInstance(); In order to try and make the changes in small incremental steps, my first plan was to allow the IServiceLocator […]

Using log4net with Unity

by Rob Levine on 28-Dec-2012

[EDIT: the Unity extension described here is now available as a NuGet package. See this post for more information] When using log4net, it is quite common to create loggers for each class using something like: 1 2 3 4 public class MyClass { private static readonly ILog logger = LogManager.GetLogger(typeof(MyClass)); } I’ve been following this pattern for […]

ConfigGen – .NET Configuration File Generator

by Rob Levine on 30-Jun-2010

After a week and a half off work and on holiday, which consisted of me working solidly on my new pet project, I am pleased to announce the first (alpha) release of ConfigGen – .NET Configuration File Generator. ConfigGen is a .Net configuration file generation tool, and it is intended to make the .Net developer’s […]