MSTest - How do I initialize log4net for a UnitTest project?
问题 I have a Visual Studio unit test project for testing an ASP.NET MVC project. Adding the assembly-level log4net.Config.XmlConfigurator attribute to AssemblyInfo.cs doesn't work and other people on SO have found they have to use a direct call to log4net.Config.XmlConfigurator.Configure(); The question is, how can this be done for a unit test? The answer to use Microsoft.VisualStudio.TestTools.UnitTesting.AssemblyInitialize attribute on a class method doesn't work. For me, this code results in