Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New install - Razor / MVC error after install, update web.config #1

Open
moorecreative opened this issue Jan 1, 2018 · 0 comments
Open

Comments

@moorecreative
Copy link

This issue is described in a bit more detail in the community forum section of the hotcakes.org site:
https://hotcakes.org/Forums/g/posts/m/547/Razor-errors-after-Installing-HotCakes-3-0-1-Module-version-into-upgraded-DNN-8-0-4

I found a solution to the issue and wanted to post it here in github so that it could be reviewed and perhaps an update would be made to the installation process to check for and add the proper line to the web.config if missing.


I'll try to be specific for anyone else who encounters this issue. Here are a few of the starting factors involved:

  • Started with a DNN 7.4 instance, upgraded to DNN 8.0.2 & performed base security updates
  • Installed Hotcakes 3.0.1 module solution install package "Hotcakes_03.00.01_Core_Install.zip"
  • All Hotcakes admin screens loaded correctly (/DesktopModules/Hotcakes/)
  • Performed setup of store information, running through Setup Wizard
  • Front-end public visible modules (such as /Store/Categories page and Category Viewer modules, /Store/Products detail page and HC Product Viewer module) displayed errors referring to "Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies"

I confirmed that the web.config for the site had the proper references for Razor which pointed to the new 3.0.0.0 version of the various System.Web.XYZ related items:

      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>

I tried a few different ways to list, register, enforce the 3.x version of "System.Web.WebPages.Razor" however they had no effect. I also tried a few other things such as loading an older 2x version in the bin folder, but that didn't help either.

In the end, by comparing the Hotcakes stand-alone full system CMS version's web.config to this DNN instance's web.config, I found a difference for a missing System.Web.Mvc assembly that was present in the hotcakes cms version:

      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
      </dependentAssembly>

Once this was added to the DNN instance's web.config, everything loaded correctly in the site and for all of the Hotcakes modules.


I believe that this means that within the Hotcakes_03.00.01_Core_Install.zip, the
Hotcakes.dnn
file should be updated to add in this binding assembly for MVC 5x I can see a reference in line 414 to removing version 4x if present, but I don't see a note to add in the version 5x bindingRedirect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant