我从AzureAD/microsoft-identity-web为 Razor Pages 运行了模板:
dotnet new webapp2 --auth IndividualB2C
哪个创建了一个项目使用
// 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 文件并看到:
<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 的新版本是 1.0.0 的 GA'd。现在这一行:
services.AddSignIn(Configuration, "AzureAdB2C");
有这个错误:
“IServiceCollection”不包含“AddSignIn”的定义,并且找不到接受“IServiceCollection”类型的第一个参数的可访问扩展方法“AddSignIn”(您是否缺少 using 指令或程序集引用?)