使用ASP.NET Core 2.0(SDK 2.1.2),当使用SignInManager<TUser>
时,我的VS Studio 2017无法识别它。我有 microsoft.aspnetcore.identity 导入。它确实识别UserManager
和RoleManager
,但不能识别SignInManager
。不知道怎么了。以下是我的csproj文件:
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.EntityFrameworkCore">
<HintPath>........Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.entityframeworkcore2.0.1libnetstandard2.0Microsoft.EntityFrameworkCore.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Identity.Core">
<HintPath>........Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.extensions.identity.core2.0.1libnetstandard2.0Microsoft.Extensions.Identity.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Identity.Stores">
<HintPath>........Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.extensions.identity.stores2.0.1libnetstandard2.0Microsoft.Extensions.Identity.Stores.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Options">
<HintPath>........Program FilesdotnetsdkNuGetFallbackFoldermicrosoft.extensions.options2.0.0libnetstandard2.0Microsoft.Extensions.Options.dll</HintPath>
</Reference>
</ItemGroup>
这在我的.NET Core 1.1应用程序中起作用(尽管我没有转换,但我从头开始另一个项目)。
如果要使用nuget,则需要以下需要:
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.0" />
</ItemGroup>
如果项目不是Web应用程序,请转到"管理Nuget软件包"并安装 Microsoft.AspNetCore.Identity