I have a simple MVC solution with 2 projects, domain and web. There is no real magic in there except that when I build the solution a log4net.dll mysteriously appears in my web project’s bin folder. I picked this up after my \Views\Shared\Error.cshtml had a squiggly line below the top line (@model System.Web.Mvc.HandleErrorInfo) saying: “Asp.Net runtime error:Could not load file or assembly log4net………….blah,blah,blah”
I do not have a reference to any log4net in any of my projects, how is the dll getting there? I do not even have anything in my web.config with the word log4net in. This is a MVC3 Framework 4 project.
It’s possible that you have installed some NuGet package which depends on log4net. If you don’t use NuGet packages maybe you have referenced an assembly which depends on log4net. So when this assembly is loaded the log4net assembly is copied as it is a dependent assembly.