3

SignalRをインストールしたところ、以下のエラーが発生します。バージョンの問題があるように見えますが、どこで修正すればよいかわかりません。NuGetインストーラーを使用してSignalRをインストールしました。

誰もがこれを修正する方法を知っていますか?

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:未定義のsignalR_test.html:35のプロパティ'client'を読み取れません

  <!--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>
  <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>

使用場所:AlumCloud

4

1 に答える 1

1

私には、Microsoft.Owin.Host.SystemWeb の特定のバージョンに依存したいアセンブリを使用していることが問題のように思えます。つまり、バージョン X ですが、ロードされる Microsoft.Owin.Host.SystemWeb のバージョンは代わりにバージョン Y。デフォルトでは、CLR はこれに対してエラーを発生させます。

これを修正するには、一貫して 1 つのバージョン (X など) を使用し、すべての依存アセンブリがそのバージョンを参照するようにします。

読み込もうとしているバージョンを正確に確認するには、ildasm/reflector 内のすべてのアセンブリを確認する必要がある場合があります。

または、CLR に「一部のアセンブリがバージョン X を要求したときにバージョン Y をロードする」というアセンブリ バインディング リダイレクトを使用して、CLR が別のアセンブリ バージョンを受け入れるように強制することもできます。これを試しても、アセンブリのパブリック インターフェイスに変更がない場合にのみ、アプリは成功します。

(注 1、あなたの質問から Microsoft.Owin.Host.Systemweb が見つかった場所を知ることはできませんが、詳細な情報が不足しているため、アプリの bin フォルダーであると想定し、回答には影響しませんが、取得しますバージョンの不一致をデバッグする方法で。)

于 2013-02-16T00:22:12.567 に答える