找不到包 Microsoft.AspNetCore.Identity.EntityFramework

Posted

技术标签:

【中文标题】找不到包 Microsoft.AspNetCore.Identity.EntityFramework【英文标题】:Unable to find package Microsoft.AspNetCore.Identity.EntityFramework 【发布时间】:2019-11-11 00:26:05 【问题描述】:

当我尝试使用 .Net 核心开发 WebApp 时。这个错误不断出现 严重性代码描述项目文件行抑制状态

错误 NU1101 。源中不存在具有此 ID 的包:Microsoft Visual Studio Offline Packages, nuget.org

我添加了正确的版本号。 我附上了我的 Csproj 文件 无法解决这个问题。帮帮我

    <Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
  </PropertyGroup>


  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity" version="2.2.0  " />
   <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFramework" version="2.2.2" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Relational.Design" Version="1.1.6" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.4">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>


  <ItemGroup>
    <Folder Include="Areas\Admin\Controllers\Views\Category\" />
  </ItemGroup>

</Project>

【问题讨论】:

【参考方案1】:

尝试换行

<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFramework" version="2.2.2" />

到这里:

<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />

【讨论】:

解决方案中的错误更多。我所有的数据模型都显示错误

以上是关于找不到包 Microsoft.AspNetCore.Identity.EntityFramework的主要内容,如果未能解决你的问题,请参考以下文章

包 Microsoft.AspNetCore.Authentication.JwtBearer 5.0.0 与 netcoreapp3.1 不兼容,但它的目标是 net 5.0

在 4.6.2 Framework 中部署 .NET Standard 程序集 (Microsoft.AspNetCore.SignalR.Client)

由于请求错误,无法安装 nuget 包

IFormFile 未从程序集“Microsoft.AspNetCore.Http 3.0”加载类型 Microsoft.AspNetCore.Http.Internal.FormFile'

Microsoft.AspNetCore.SpaServices.Extensions 的文档在哪里?

NETSDK1073:无法识别 FrameworkReference 'Microsoft.AspNetCore.App'