API errors

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

API errors

Post by jguengerich » Fri Dec 19, 2014 12:06 pm

I am using GOLD R5 with source code. I have some custom code added to the CommerceBuilder.WebApi project. I am using VS 2013 for development. Today I needed to make a change to one of my custom API methods (last change was back in August). After building the project and copying the resulting DLL to the test web server (Stop -> copy file -> Start), I got this error when trying to access the site (any page):
Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.1, 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)
I copied the development system's System.Web.Mvc.dll to the web site's bin folder (Stop -> copy file -> Start), and I was able to get to the web site. However, now when I try to go to /api/help, I get this error:
<Error><Message>No HTTP resource was found that matches the request URI 'https://[test server]/api/help'.</Message><MessageDetail>No type was found that matches the controller named 'help'.</MessageDetail></Error>
I'm guessing there is one or more additional steps I need to take related to the DLL version change, but I'm not sure what else I need to do.
I tried changing the bindingRedirect line for System.Web.Mvc in my web.config file:

Code: Select all

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="NHibernate" culture="neutral" publicKeyToken="aa95f207798dfdb4" />
        <bindingRedirect newVersion="3.3.1.4001" oldVersion="0.0.0.0-3.3.1.4001" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
to use "4.0.0.1" instead of "4.0.0.0", but that doesn't help (same "No HTTP resource was found..." message).

Can anyone help with this?
Jay

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: API errors

Post by jguengerich » Fri Dec 19, 2014 1:48 pm

Figured it out :D . I had to change the WebApi project's References to point to System.Web.Mvc.dll in the Lib folder of the source instead of the development machine's GAC (C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies). Then just leave everything as it was on the server (no change to web.config, no copying newer System.Web.Mvc.dll) and just copy the new CommerceBuilder.WebApi.Dll.
Jay

Post Reply