Blog home

Updated demo sites have been published

Updated versions of the demo sites have beeen published, so the next time you install one of the demo sites, it will run build 1575 and use .Net 4.5.1. The upgrade process worked well for most of the sites, but the Shopdemo was a bit of effort to upgrade. The main reason for that is that it used a prerelease version of SignalR (0.4). The version of SignalR shipping in Relatude 4.8 and later is version 2.0.3. There are big changes between those versions of SignalR, so it took a few hours to fix.

I know there are a couple of shops in development that uses the shopdemo as a startingpoint for their own projects. In order to be able to upgrade to later versions of Relatude, I would suggest you follow the step-by-step guide below:

 

Upgrade process when using an old version of the shopdemo:

- Upgrade to the latest version of Relatude

-  In web.config: Change <staticContent>

      < mimeMap fileExtension =".woff " mimeType ="application/x-font-woff " />

    </ staticContent>
to:

<staticContent>

<remove fileExtension =".woff "/>

      < mimeMap fileExtension =".woff " mimeType ="application/x-font-woff " />

    </ staticContent>

- Remove references to Newtonsoft 3.5 (exclude dll)

- Add new SignalR using Nuget

- Run site as .Net 4.5.1 or higher

- In hub code, change method calls from Caller.clientmethod to Clients.Caller.clientmethod

- Change javascript file reference from old signalr file to the new version.

- The Javascript code will give this error: “Error "Uncaught TypeError: Object #<Object> has no method 'send'"” Fixed by adding hubobject.server.methodnameOnServer

- Add Owin startup class to App_code:

using Owin;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

 

public class Startup {

public void Configuration(IAppBuilder app) {

        app.MapSignalR();

    }

}

- One of the changes in SignalR is the fact that session is not available. This forces some changes to the hubs and search classes:

- Change ProductSearchService to add a session parameter to the constructor

- Update using statements that refer to SignalR.* to Microsoft.AspNet.SignalR

- Exclude old signalr dll (starts with Signalr).

- Change ProductCategoryPage.aspx.cs to send a session to the constructor of the ProductSearchService.

- In ProductSearchService, use the session supplied to the constructor rather than WAFContext.

- Update ProductSearchHub to send a session to the ProductSearchService constructor. Create the session with the following code:

        IRequest request = Context.Request;

string viewSessionId = request.Cookies["ViewSessionId" ].Value;

WAFSession session = WAFRuntime .Engine.GetSession(new Guid(viewSessionId));

//Perform search

ProductSearchService searchService = new ProductSearchService (settings, session);

 

If you have problem doing this upgrade, download a fresh copy of the shopdemo to compare. If you still struggle to get it working, ask in the forum or contact support@relatude.com.

13.05.2014
Posted by: Vidar Langberget
Categories:
  
Comments (0)

You need to login to post comments!