2017-02-13 417 views
0

我試圖實施Hangfire授權,我發現像this這樣的解決方案可能適用於我,但我無法實現接口 IDashboardAuthorizationFilter。不知道我必須使用什麼命名空間來獲得這個工作,或者如果我有任何缺少的庫。請建議。哪裏可以找到「IDashboardAuthorizationFilter」界面(Hangfire)

我的包版本: 遲髮型:v 1.6.8 Hangfire.Dashboard.Authorization:v 2.1.0(最新)

我也試着更新遲髮型到最新的,但沒有得到任何運氣。

上傳:我沒有足夠的代表發表評論該帖子。因此,發佈爲新問題。

謝謝!

更新:

我的代碼

using System; 
using Owin; 
using Hangfire; 
using Hangfire.Dashboard; 
using System.Collections.Generic; 
using Hangfire.SqlServer; 
using System.Web; 

namespace Example 
{ 
    public class HangFireAuthorizationFilter : **IDashboardAuthorizationFilter** //getting error here 
    { 
     public bool Authorize(IDictionary<string, object> owinEnvironment) 
     {   
      return HttpContext.Current.User.Identity.IsAuthenticated; 
     } 
    } 
} 

更新2: 看起來像我的NuGet包是最新的遲髮型但我refernced Hangfire.Core DLL是不是最新的。現在是1.58。當我重新安裝nuget軟件包時,它仍然保持不變。

+0

僅供參考,您可以訪問此處的Hangfire源代碼https://github.com/HangfireIO –

+0

是的。我已經下載並嘗試構建解決方案來獲取所需的dll,但我正在研究爲什麼包上的更新不能自動替換dll的問題。謝謝。 – CodeNinja

+0

我的意思是你可以從代碼庫找到接口所屬的名稱空間的答案 –

回答

0

刪除Hangfire.Core nuget包並重新安裝它爲我工作。另外,我在同一個項目的共享庫中有一些舊的hangfire dll,這就是當我安裝新版本時導致dll覆蓋的原因。