views:

45

answers:

0

Hi. I have a website that was developed using ASP.Net MVC and uses Log4net for exception logging. The website was running fine until about 4 hours ago. We haven't made any changes to the website in the last 2 weeks. The website has been running smoothly since we put it up about 1 month ago. The website is hosted at our ISP on a Shared Hosting account.

This is the exception we are receiving:

[FormatException: String was not recognized as a valid Boolean.]
   log4net.Core.LoggerManager.RegisterAppDomainEvents() +0
   log4net.Core.LoggerManager..cctor() +33

[TypeInitializationException: The type initializer for 'log4net.Core.LoggerManager' threw an exception.]
   log4net.Core.LoggerManager.GetLogger(Assembly repositoryAssembly, String name) +0
   log4net.LogManager.GetLogger(Assembly repositoryAssembly, String name) +8
   log4net.LogManager.GetLogger(String name) +20
   i3t.LcaWeb.View.MvcApplication..cctor() in Global.asax.cs:17

[TypeInitializationException: The type initializer for 'i3t.LcaWeb.View.MvcApplication' threw an exception.]
   i3t.LcaWeb.View.MvcApplication..ctor() +0
   ASP.global_asax..ctor() in App_global.asax.fqjmwqjv.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +215
   System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext context) +8878568
   System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext context) +136
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +92
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289

The exception is being thrown in the Global.asax, where an instance of log4net.ILog is being created:

public class MvcApplication : System.Web.HttpApplication
{
    private static log4net.ILog log = log4net.LogManager.GetLogger("global.asax");

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            "Home.aspx",
            "",
            new { action = "Index", controller = "Home" }
        );

The problem doesn't happen in testing - we are unable to reproduce it. I have deleted all the files on the live website, and re-uploaded them, just in case something could have been corrupted, but this hasn't solved the problem.

I believe that something might have changed on the ISP side that broke something.

Any clues on how to solve this problem?