I've just installed SignalR and am getting the error below. Looks as if I've got a version issue but I do not know where to fix it. I've installed the SignalR using the NuGet installer.
Anyone know how to fix this?
Could not load file or assembly 'Microsoft.Owin.Host.SystemWeb, Version=0.10.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)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Owin.Host.SystemWeb, Version=0.10.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)
Source Error:
Line 35: protected void Session_Start(Object sender, EventArgs e)
Line 36: {
Line 37: RouteTable.Routes.MapHubs();
Line 38: }
Line 39: }
Uncaught TypeError: Cannot read property 'client' of undefined signalR_test.html:35
<!--Script references. -->
<script src="../Scripts/jquery-1.9.1.js"></script>
<script src="../Scripts/jquery.signalR-1.0.0-rc1.js"></script>
<script src="../Scripts/jquery.signalR-1.0.0-rc1.min.js"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="/signalr/hubs"></script>
<!--Add script to update the page and send messages.-->
<script type="text/javascript">
$(function () {
// Declare a proxy to reference the hub.
var chat = $.connection.CollaboratorHub;
// Create a function that the hub can call to broadcast messages.
chat.client.broadcastMessage = function (name, message) {
// Html encode display name and message.
--Packages.
<packages>
<package id="EntityFramework" version="5.0.0" targetFramework="net45" />
<package id="jQuery" version="1.8.2" targetFramework="net45" />
<package id="jQuery.UI.Combined" version="1.8.11" targetFramework="net45" />
<package id="jQuery.Validation" version="1.9.0.1" targetFramework="net45" />
<package id="knockoutjs" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Providers.Core" version="1.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Providers.LocalDB" version="1.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.SignalR" version="1.0.0-rc1" targetFramework="net45" />
<package id="Microsoft.AspNet.SignalR.Core" version="1.0.0-rc1" targetFramework="net45" />
<package id="Microsoft.AspNet.SignalR.JS" version="1.0.0-rc1" targetFramework="net45" />
<package id="Microsoft.AspNet.SignalR.Owin" version="1.0.0-rc1" targetFramework="net45" />
<package id="Microsoft.AspNet.SignalR.SystemWeb" version="1.0.0-rc1" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="4.0.20505.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.jQuery.Unobtrusive.Ajax" version="2.0.20505.0" targetFramework="net45" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="2.0.20505.0" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.Owin.Host.SystemWeb" version="1.0.0-rc1" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="4.5.9" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="WebGrease" version="1.1.0" targetFramework="net45" />
</packages>
Where it is being used: AlumCloud
To me it sounds like the problem is you're using some assembly that wants to depend on a specific version of Microsoft.Owin.Host.SystemWeb: i.e. version X, but the version of Microsoft.Owin.Host.SystemWeb getting loaded is instead version Y. The CLR will raise an error for this by default.
You can fix this by making sure you are using one version (e.g. X) consistently and that all your dependent assemblies reference that version.
You may need to look at all your assemblies in ildasm/reflector to see exactly what version they are trying to load.
OR, you can try to force the CLR to accept the different assembly version by using an assembly binding redirect which says to the CLR "load version Y when some assembly asks for version X". Even if you try this your app will only succeed if there are no changes in the assembly public interface.
(Note 1, I can't tell from your question where it found Microsoft.Owin.Host.Systemweb but with lack of further information I would assume its the app bin folder, and it doens't affect the answer, but it does get in the way of debugging the version mismatch.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With