获取SignalR连接启动方法的例外

时间:2014-01-02 12:58:18

标签: asp.net signalr

我正在使用SignalR创建应用程序。我已按照以下所有配置开始使用SignalR。  启动类

[assembly: OwinStartup("TestingConfiguration", typeof(UsingFoundation.Startup))]

namespace UsingFoundation
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            string sqlConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ProjectDBEntities"].ConnectionString;
            if (!string.IsNullOrWhiteSpace(sqlConnectionString))
            {
                GlobalHost.DependencyResolver.UseSqlServer(sqlConnectionString);
            }
            app.MapSignalR();
        }
    }
}

的AppSettings

<appSettings>
    <add key="owin:appStartup" value="TestingConfiguration" />
  </appSettings>

Hub Class

namespace UsingFoundation
{
    [HubName("chathub")]
    public class ChatHubClass : Hub
    {
        public void Hello()
        {
            Clients.All.hello();
        }
    }
}

现在当我要开始我的集线器连接时,我从Chrome console收到以下错误。 Error Window

脚本链接到页面

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.signalR-2.0.1.min.js" type="text/javascript"></script>
    <script src="/signalr/hubs" type="text/javascript"></script>

1 个答案:

答案 0 :(得分:1)

Resolved' I am using SignalR SQL Server integration with EntityFramework . Error is is ConnectionString . EntityFramework`连接字符串无效,包含XML文件的路径。

  

不工作

<connectionStrings>
    <add name="ProjectDBEntities" connectionString="metadata=res://*/ProjectModel.csdl|res://*/ProjectModel.ssdl|res://*/ProjectModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(local);initial catalog=ProjectDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

WORKING

"data source=(local);initial catalog=ProjectDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework";