DotNetNuke, DNN, Modules and SignalR 2.0.0

DotNetNuke, DNN, Modules and SignalR 2.0.0

In October, the SignalR project had their first official 2.0.0 release, and with that comes a number of changes to make your modules work with SignalR. You can upgrade your SignalR package via Nuget.

You can find a guide to upgrading your projects at https://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/upgrading-signalr-1x-projects-to-20

A couple of big changes that I found.

  1. .NET 4.5 is required (the DNNCHAT module was already on 4.5)
  2. The way Hubs are mapped/routed has changed to use OwinStartup (see documentation in the link above, or this page for DNNChat)

Since the 2.0.0 release of SignalR, there has been a new release of Microsoft.Owin (2.0.1). It appears that the SignalR code is compiled against Microsoft.Owin 2.0.0 and will not work out of the box in DNN anymore. Due to the way that DNN loads the class libraries (assemblies) inside of the APP (DNN) you need to add some extra information to the web.config in the root of the DNN website.

      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.1.0" newVersion="2.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.1.0" newVersion="2.0.1.0" />
      </dependentAssembly>


 

For now you can manually add that to your web.config file, I plan to make the dnnCHAT module add it automatically on install/upgrade, but haven't come up with the .DNN manifest code for that yet.

Currently, the source code for dnnCHAT on GitHub uses SignalR 2.0, but the latest release of DNNCHAT still uses an older release.

Recent Comments

Comment Avatar
Hi Chris, Currently I'm facing the same problem with a DNN module. Normally you would add the depent assemblies in the DNN file during install of the package.But this does not seem to work because when you install the module it places all the dll's in the bin and triggers an app recycle which triggers the owin startup. This is the moment when the application breaks and further install actions halt. I also tried to add the lines in the IUpgradeable. But also this is'nt fired anymore when the dll's are placed. So I'm wondering, did you allready found a workaround ? Thanks
Posted By: Martin vds on Aug 2014
Comment Avatar

Useful information. Please update new informationl

Posted By: James David on Jan 2019

Add Comment

Please add your comment by filling out the field(s) below. Your comment may need to be approved before it becomes visible.
Enter your first name for display with the comment
Enter your last name for display with the comment.
Enter your comment here.
If you can't type DNNRocks in, you can't post, plain and simple.
Submit Comment Cancel

Chris Hammond

Chris Hammond is a father, husband, leader, software developer, photographer and car guy. Chris focuses on the latest in technology including artificial intelligence (AI) and has spent decades becoming an expert in ASP.NET and DotNetNuke (DNN) development. You will find a variety of posts relating to those topics here on the website. For more information check out the about Chris Hammond page.

Find me on Twitter, GitHub and LinkedIn.