我正在使用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
收到以下错误。
脚本链接到页面
<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>
答案 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="data source=(local);initial catalog=ProjectDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
WORKING
"data source=(local);initial catalog=ProjectDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework";