【问题标题】:ASP.NET unable to add a referenceASP.NET 无法添加引用
【发布时间】:2019-07-31 21:20:16
【问题描述】:
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 查看图片了解更多详情image

【问题讨论】:

  • 您使用的是哪个版本的 Asp.net Core?
  • 你能显示项目文件来检查参考吗?
  • 你确定这甚至是 ASP.NET Core MVC 吗?您是否添加了对身份的引用?

标签: asp.net-core asp.net-core-mvc asp.net-identity


【解决方案1】:

将以下PackageReference 添加到YourProject.csproj 文件并重建。问题应该会消失,因为这个元包包含 ASP.NET Core 版本

的 ASP.NET Core MVC、Entity Framework Core 和 ASP.NET Core Identity 的所有必要包
 <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App"/>
    .......
 </ItemGroup>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-15
    相关资源
    最近更新 更多