首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用模板中的services.AddSignIn(Configuration,"AzureAdB2C")时,“IServiceCollection”不包含“AddSignIn”的定义

使用模板中的services.AddSignIn(Configuration,"AzureAdB2C")时,“IServiceCollection”不包含“AddSignIn”的定义
EN

Stack Overflow用户
提问于 2020-10-05 09:25:04
回答 1查看 594关注 0票数 3

我从AzureAD/microsoft-identity-web运行了剃刀页面的模板:

代码语言:javascript
复制
dotnet new webapp2 --auth IndividualB2C

创建了一个项目,使用

代码语言:javascript
复制
    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddSignIn(Configuration, "AzureAdB2C");
        services.AddRazorPages()
                .AddMicrosoftIdentityUI();
    }

但我查看了.csproj文件,发现:

代码语言:javascript
复制
  <ItemGroup>
    <PackageReference Include="Microsoft.Identity.Web" Version="0.1.2-preview"/>
    <PackageReference Include="Microsoft.Identity.Web.UI" Version="0.1.2-preview"/>
  </ItemGroup>

所以我升级了它们,因为它看起来像Microsoft.Identity.Web was GA'd at 1.0.0的新版本。现在是这样的:

代码语言:javascript
复制
services.AddSignIn(Configuration, "AzureAdB2C");

出现以下错误:

“IServiceCollection”不包含“AddSignIn”的定义,并且找不到接受类型为“IServiceCollection”的第一个参数的可访问扩展方法“AddSignIn”(是否缺少using指令或程序集引用?)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-08 00:00:18

Microsoft.Identity.Web的nuget包中提供了0.1.5 Preview版本之前的services.AddSignIn(),以上版本不包含services.AddSignIn()

请通过Microsoft.Identity.Webrelease notes

在当前版本1.1.0中,您可以用services.AddMicrosoftIdentityWebAppAuthentication()替换services.AddSignIn()

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64201409

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档