找不到软件包Microsoft.AspNetCore.Identity.EntityFramework

时间:2019-06-29 11:26:03

标签: c# csproj visual-studio-2019

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

错误NU1101无法找到包Microsoft.AspNetCore.Identity.EntityFramework。源中不存在具有此ID的软件包:Microsoft Visual Studio脱机软件包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 个答案:

答案 0 :(得分:0)

尝试从以下位置更改行

   package fr.spectrumgroupe.panel.dao;
   import fr.spectrumgroupe.panel.entity.personne;
   public interface  personnedao {

public personne addpersonne (String id , String nom , String prenom);

public personne Getpersonne(String id,String nom , String prenom);


    }

对此:

     `package fr.spectrumgroupe.panel.DaoImpl;
      import javax.inject.Inject; import javax.inject.Named;
 import com.atlassian.activeobjects.external.ActiveObjects;
 importcom.atlassian.jira.component.ComponentAccessor;
 importcom.atlassian.jira.util.I18nHelper;
   import  com.atlassian.plugin.spring.scanner.annotation. 
        component.Scanned;
       import com.atlassian.plugin.spring.scanner.annotation.
          imports.ComponentImport;

   import fr.spectrumgroupe.panel.dao.personnedao;
   import fr.spectrumgroupe.panel.entity.personne;
     import net.java.ao.DBParam;@Scanned@Namedpublic class 
          PersonneDaoImpl implements personnedao {

@ComponentImport
private final ActiveObjects ao;
I18nHelper i18nHelper = 
 ComponentAccessor.getComponentOfType(I18nHelper.class);
@Inject
public PersonneDaoImpl(ActiveObjects ao)
{
    this.ao = ao;
}@Override

public personne Getpersonne (String id ,String nom, String prenom) {
    personne[] personne = ao.find(personne.class, "ID =  ? NOM = ? AND PRENOM = ?", new Object[] { id.toString().trim(),nom.toString().trim(), prenom.toString().trim() });
    if (personne.length > 0) {
    return personne[0];

    } 
    else {
    return null;
    }
    }  }