Recently I moved an AbleCommerce Gold R12 install to Windows Server 2019. Immediately the RESTful Web API built into the app started responding with 404 errors. It was as if the MVC routes simply no longer existed even though they were clearly being built in the web api bootstrap code.

Fast forward to today as I deploy a minor unrelated update to another DLL. As part of that update, the System.Web.WebPages dll was also deployed. Something recently had updated that DLL.

While everything worked locally, suddenly the .Net application was throwing 500 errors. Couldn’t even get an Exception page to render. Event log showed the following:

Could not load file or assembly ‘System.Web.WebPages, Version=2.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)
at System.Web.Mvc.PreApplicationStartCode.Start()

My only choice was to use RegEdit to enable assembly binding logs on the server using these steps:

Within HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion

Add:
DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
DWORD EnableLog set value to 1
String LogPath set value to folder for logs (e.g. C:\FusionLog\)

Make sure you create that folder C:\FusionLog\ and then restart IIS. Now tap the site to trigger the IIS startup of the app pool and check the logs.

Once I found the log file for the System.Web.WebPages binding, I was able to see that the binding wanted to find v2.0.0.0 of the DLL. But after looking in the /bin/ folder, I could see the DLL I had there was only v1.0.0.0. So that’s why the bootup of the app failed to happen.

After some googling, I found that Server 2019 when running my particular AbleCommerce install requires an older version of ‘Web Pages With Razor’. The download for this install can be found on Microsoft’s website at this url:

https://www.microsoft.com/en-us/download/details.aspx?id=34600

Once the install was done, I restarted IIS and the application immediately booted up without issue. Problem solved!