从现有项目(asp.net 4.0网站)开始,其中实现路由以使URL更加SEO友好,我试图嵌入包括从这里采取的项目
http://www.codeproject.com/Articles/562023/Asp-Net-SignalR-Chat-Room
因为我需要在我的global.asax中写入注册默认集线器路由:〜/ signalr / hubs
我在下面的代码中看到了以下代码行RouteTable.Routes.MapHubs()
<%@ Application Language="VB" %>
<%@ Import Namespace="System.Web.Routing" %>
<%@ Import Namespace="Microsoft.AspNet.SignalIR.Owin" %>
<%@ Import Namespace="Microsoft.AspNet.SignalIR.SystemWeb" %>
<script runat="server">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
'Add an hub route : ~/signalr/hubs
RouteTable.Routes.MapHubs()
' Code that runs on application startup
Me.RegisterRoutes(RouteTable.Routes)
End Sub
'Added for redirect and rewriting URL
Sub RegisterRoutes(ByVal routeCollection As RouteCollection)
routeCollection.MapPageRoute("RouteCercaPerTipologia", "find/{type}/", "~/find-type.aspx", False,
End Sub
</script>
问题出在该行代码上,错误信息是:
Could not load file or assembly 'Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5' or one of its dependencies. The system cannot find the file specified.
但是你可以看到我在global.asax文件的顶部有导入。 我不得不说,我之前提到的项目是使用框架4.0,但我引用的程序集是4.5这里的路径:
\Visual Studio 2012\Projects\SignalRChatRoom\packages\Microsoft.AspNet.SignalR.Owin.1.0.0\lib\net45\Microsoft.AspNet.SignalR.Owin.dll
和
\Visual Studio 2012\Projects\SignalRChatRoom\packages\Microsoft.AspNet.SignalR.SystemWeb.1.0.0\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.dll
我尝试删除并再次引用文件但没有任何效果,我实现的路由与聊天DLL之间是否存在冲突?