你在哪里找到GoogleOAuth2AuthenticationOptions?

5

我感觉自己缺少一些很基础的东西,但我已经努力解决了。

基本上,我正在尝试遵循这个问题的答案:https://dev59.com/82Mm5IYBdhLWcg3wB7V5#22694372

它使用了一个GoogleOAuth2AuthenticationOptions对象,从我的谷歌搜索结果来看,应该在.net4.5框架中位于这里:Microsoft.Owin.Security.Google.GoogleOAuth2AuthenticationOptions

然而我的MVC项目是.NET 4.5,但它并不存在!尽管它说应该存在:http://www.symbolsource.org/Public/Metadata/NuGet/Project/Microsoft.Owin.Security.Google/2.1.0-rc1/Release/.NETFramework,Version%3Dv4.5/Microsoft.Owin.Security.Google/Microsoft.Owin.Security.Google/GoogleOAuth2AuthenticationHandler.cs?ImageName=Microsoft.Owin.Security.Google。所以,GoogleOAuth2AuthenticationOptions到底在哪里呢?哈哈

只是缺少GoogleOAuth2AuthenticationOptions吗?还是Microsoft.Owin.Security.Google命名空间也没有? - CathalMF
1
所以我假设你已经添加了对Microsoft.Owin.Security.Google.dll的引用? - CathalMF
2
你引用了哪个版本的 Microsoft.Owin.Security.Google.dll? - CathalMF
这是框架版本而不是文件版本。但无论如何,根据MSDN,没有这样的类。因此,我认为Stack Overflow的答案是错误的。http://msdn.microsoft.com/en-us/library/microsoft.owin.security.google(v=vs.113).aspx - CathalMF
2
尝试使用v2.1.0版本 https://katanaproject.codeplex.com/releases/view/113281 如果需要,请升级NuGet软件包。http://www.nuget.org/packages/Microsoft.Owin.Security.Google/2.1.0 - ta.speot.is
显示剩余2条评论
3个回答

6
解决方案很简单,只需要在Nuget中更新Microsoft.Owin.Security.Google的版本即可。

3

你需要获取Microsoft.Owin.Security.Google。

在Visual Studio中,执行以下步骤:打开工具->库包管理器->管理解决方案的NuGet包...,然后在搜索框中输入Microsoft.Owin.Security.Google并选择Microsoft.Owin.Security.Google包,按“安装”按钮进行安装。

同样的方式安装“Microsoft.Owin”。


3

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接