DotNetNuke 7 upgrade issues - RESOLVED

Discussion in 'Third-party applications' started by dbeach, Jan 7, 2013.

  1. I managed to troubleshoot my DNN7 upgrade and hopefully this note will save others some trouble.

    Situation: You have installed DNN from the Web App Gallery and you are ready to upgrade to version 7.0. You've done the upgrade several times on a local server without issues and now it's time to upgrade on DiscountASP server.

    After ftp'ing the upgrade files you attempt to initiate the upgrade via http://www.<yoursite>.com/install/install.aspx?mode=upgrade and it fails! :mad:

    Edit the web.config for CustomErrors="Off" and you see:

    Could not load file or assembly 'System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    Stack trace info looks something like:

    [FileLoadException: Could not load file or assembly 'System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
    System.Web.WebPages.Administration.SiteAdmin.RegisterAdminModule() +0
    System.Web.WebPages.Administration.PreApplicationStartCode.Start() +22

    [InvalidOperationException: The pre-application start initialization method Start on type System.Web.WebPages.Administration.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
    System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +423
    System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677

    [HttpException (0x80004005): The pre-application start initialization method Start on type System.Web.WebPages.Administration.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090876
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256

    I was unable to determine exactly what is referencing an older System.Web.Webpages assembly, but no matter! :p

    The workaround I used was to add bindingRedirect statements as shown below:

    <!-- ************************************************************** -->
    <!-- START DNN7 upgrade failure workaround -->
    <!-- ************************************************************** -->
    <!-- ** be sure these are in the section for ** -->
    <!-- ** assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1 ** -->
    <!-- ************************************************************** -->
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
    </dependentAssembly>
    <!-- ************************************************************** -->
    <!-- END DNN7 upgrade failure workaround -->
    <!-- ************************************************************** -->


    This will probably come back to bite me at some point, but its an effective workaround for now.

    Good Luck,
    David
     
  2. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    Thanks for posting this, David. I'm sure it will help a lot of people out.
     

Share This Page