SignalR 2.0.2 and Owin 2.0.0 dependency conflict

后端 未结 3 700
北荒
北荒 2020-12-09 15:17

I\'m trying to get SignalR working in an MVC5 project with individual accounts.

The MVC project has by default Owin 2.0.0 and all of the Owin.* components are also

相关标签:
3条回答
  • 2020-12-09 16:06

    Perhaps you need a binding redirect in your .config

    <configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    </configuration>
    
    0 讨论(0)
  • 2020-12-09 16:07

    You can update this references to the lastest version I found (now is 2.1.0):

    Install-Package Microsoft.Owin -Version 2.1.0
    Install-Package Microsoft.Owin.Security -Version 2.1.0
    

    And make sure your Web.config have these binding redirects for version 2.1.0:

    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
    

    Or you can update this references to version 2.0.1:

    Install-Package Microsoft.Owin -Version 2.0.1
    Install-Package Microsoft.Owin.Security -Version 2.0.1
    

    And make sure your Web.config have these binding redirects for version 2.0.1:

    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <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>
        </assemblyBinding>
      </runtime>
    </configuration>
    
    0 讨论(0)
  • 2020-12-09 16:15

    In my case when I hosted my WCF service that has SignalR functionality in IIS and when I go to my IIS manager and to my application where I hosted my service right click svc file and click Browse, I was getting this error. So I did the following

    In my Visual Studio, Tools -> Library Package Manager -> Package Manager Console

    I made sure I selected my Website project that hosted my WCF service and gave below two commands one after another

    uninstall-package Microsoft.AspNet.SignalR
    
    install-package Microsoft.AspNet.SignalR
    

    After this I just re-build my solution. Went to IIS manager and to my application where I hosted my service right click svc file and click Browse, I was able to see my service running in IE.

    0 讨论(0)
提交回复
热议问题