asp.net-core - ASP.NET 无法添加引用
问题描述
using System;
using Microsoft.AspNetCore.Identity;
namespace SC.BL.Domain
{
// Add profile data for application users by adding properties to the WebApp1User class
public class WebApp1User : IdentityUser
{
public string OwnerID { get; set; }
[PersonalData]
public string Name { get; set; }
[PersonalData]
public DateTime DOB { get; set; }
public UserStatus UserStatus { get; set; }
}
public enum UserStatus
{
Submitted,
Approved,
Rejected
}
}
在参考中找不到 AspNetCore: using Microsoft.AspNetCore.Identity See image for more details image
解决方案
将以下内容添加PackageReference
到YourProject.csproj
文件并重建。问题应该会消失,因为这个元包包含 ASP.NET Core MVC、Entity Framework Core 和 ASP.NET Core Identity for ASP.NET Core Version <= 2.2的所有必要包
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App"/>
.......
</ItemGroup>
推荐阅读
- excel - 使用 VBA 密码保护自动报告
- vue.js - 错误不知道如何把这个值变成一个节点
- javascript - Mat-Checkbox 绑定模型可以是可选的还是空的?
- c++ - 如何在 C++ 上启动异步线程
- flutter - FutureBuilder 总是返回 Future 的实例
- c++ - 使用相同的方法对不同的类使用一个变量
- sql - 将两个 datetimes2 变量比较结果设置为另一个位变量的 SQL Server 简单表达式将不起作用
- c# - 比较 if 语句中的枚举
- java - swt FormText 中的 Java 链接
- sql - 按字母顺序对给定字符串排序并返回字母