2015-12-25 28 views
2

我需要構建具有實時SQL Server通知的應用程序(數據庫將從外部應用程序更新)。 我使用ASP.NET 5(MVC 6)。我想使用的SqlDependency但它是在DNX核心5.0不可用,我得到一個錯誤:DNX Core上的MVC 6中的SqlDependency

CS0246 The type or namespace name 'SqlDependency' could not be found (are you 
missing a using directive or an assembly reference?) 

我能做些什麼在MVC 6

+0

您是否使用DNX Core,因爲想在Mac/Linux上運行您的應用程序? –

回答

1

如果您打算在Windows上運行它使用的SqlDependency,你可以刪除DNX核心並使用dnx46。

"frameworks": { 
    "dnx46": {} 
} 
+1

你在哪裏連接了事件,通常你把它放在Application_Start中,但是asp.net mvc 6沒有這個事件? //使用應用程序初始化啓動SqlDependency SqlDependency.Start(connString); – DotnetShadow