Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
信号器和c#导致版本错误_C#_Jquery_.net_Signalr - Fatal编程技术网

信号器和c#导致版本错误

信号器和c#导致版本错误,c#,jquery,.net,signalr,C#,Jquery,.net,Signalr,我刚刚安装了信号器,下面是错误信息。看起来好像我有一个版本问题,但我不知道在哪里修复它。我已经使用NuGet安装程序安装了信号器 有人知道怎么解决这个问题吗 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

我刚刚安装了信号器,下面是错误信息。看起来好像我有一个版本问题,但我不知道在哪里修复它。我已经使用NuGet安装程序安装了信号器

有人知道怎么解决这个问题吗

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:     }

未捕获的TypeError:无法读取未定义的signalR_test的属性“client”。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. 

$(函数(){
//声明代理以引用中心。
var chat=$.connection.CollaboratorHub;
//创建一个中心可以调用以广播消息的函数。
chat.client.broadcastMessage=函数(名称、消息){
//Html编码显示名称和消息。

--包裹

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


使用位置:

对我来说,问题似乎是您使用的某个程序集希望依赖于特定版本的Microsoft.Owin.Host.SystemWeb:即版本X,但加载的Microsoft.Owin.Host.SystemWeb版本是版本Y。默认情况下,CLR将为此引发错误

您可以通过确保一致地使用一个版本(如X)并确保所有依赖程序集都引用该版本来解决此问题

您可能需要查看ildasm/reflector中的所有程序集,以确切了解它们试图加载的版本

或者,您可以尝试使用对CLR说“当某个程序集请求版本X时加载版本Y”的命令来强制CLR接受不同的程序集版本。即使尝试此操作,您的应用程序也只能在程序集公共界面没有更改的情况下才能成功


(注意1,我无法从您的问题中判断它是在哪里找到Microsoft.Owin.Host.Systemweb的,但由于缺乏进一步的信息,我假设它位于app bin文件夹中,它不会影响答案,但它确实会妨碍调试版本不匹配。)

你是说使用NuGet吗?>使用netgu安装程序,我已经更新到正确的拼写。