2017-01-27 35 views
0

我已經看過在MSDN網站,計算器和很多例子......到處谷歌認證加入象下面這樣:UseGoogleAuthentication產生錯誤不能轉換lambda表達式類型

app.UseGoogleAuthentication(options => 
    { 
     options.ClientId = "CLIENTID"; 
     options.ClientSecret = "CLIENTSECRET"; 
    }); 

,但在我的代碼,整個下劃線用紅色錯誤指示給出錯誤:

Cannot convert lambda expression to type 'GoogleOptions' because it is not a delegate type

什麼可能是錯誤的? 我使用Asp.NET MVC .NetCore

回答

0

安裝的NuGet如果沒有安裝已Microsoft.AspNetCore.Authentication.Google及以下更改googleoptions。

app.UseGoogleAuthentication(new GoogleOptions() 
{ 
    ClientId = Configuration["ClientId"], 
    ClientSecret = Configuration["ClientSecret"] 
}); 
相關問題