代码之家  ›  专栏  ›  技术社区  ›  x19

从ASP迁移。NET Core 3.1到5.0

  •  1
  • x19  · 技术社区  · 4 年前

    从ASP。NET Core 3.1到5.0我遇到了这个问题:

    检测到错误NU1107版本冲突 微软。EntityFrameworkCore。关系。

    安装/参考Microsoft。EntityFrameworkCore。关系5.0.0直接到项目Alpha。网状物。应用程序来解决此问题。

    阿尔法。网状物。应用程序-> 微软。EntityFrameworkCore。工具5.0.0-> 微软。EntityFrameworkCore。设计5.0.0-> 微软。EntityFrameworkCore。关系型(>=5.0.0)

    阿尔法。网状物。应用程序-> 柚子。EntityFrameworkCore。MySql 3.2.4-> 微软。EntityFrameworkCore。关系型(>=3.1.8&< 5.0.0).

    E: \项目\阿尔法\阿尔法。网状物。应用程序\阿尔法。网状物。附录C项目1

    我该怎么解决?

    阿尔法。网状物。附录C项目:

    <Project Sdk="Microsoft.NET.Sdk.Web">
    
      <PropertyGroup>
        <TargetFramework>net5.0</TargetFramework>
        <UserSecretsId>XXXXXXuser secret idXXXXXXXX</UserSecretsId>
      </PropertyGroup>
    
      <ItemGroup>
              <!-- ...-->
      </ItemGroup>
    
      <ItemGroup>
              <!-- ...-->
      </ItemGroup>
    
      <ItemGroup>
              <!-- ...-->
      </ItemGroup>
    
      <ItemGroup>
        <None Remove="migrations.sql" />
      </ItemGroup>
    
      <ItemGroup>
        <PackageReference Include="HtmlAgilityPack" Version="1.11.28" />
        <PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="5.0.0" />
        <PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="5.0.0" />
        <PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="5.0.0" />
        <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.0" />
        
        <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0" />
        <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.0" Condition="'$(Configuration)' == 'Debug'" />
        <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1">
          <PrivateAssets>all</PrivateAssets>
          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
        </PackageReference>
    
    
        <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
        <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />
        <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0">
          <PrivateAssets>all</PrivateAssets>
          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
        </PackageReference>
        <PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="5.0.0" />
        <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
        <PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
        <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.0" />
        <PackageReference Include="NLog.Extensions.Logging" Version="1.6.5" />
        <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.2.4" />
        <PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.5" />
        <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.3" />
      </ItemGroup>
    
      <ItemGroup>
        <ProjectReference Include="..\Alpha.DataAccess\Alpha.DataAccess.csproj" />
        <ProjectReference Include="..\Alpha.Infrastructure\Alpha.Infrastructure.csproj" />
        <ProjectReference Include="..\Alpha.LoggerService\Alpha.LoggerService.csproj" />
        <ProjectReference Include="..\Alpha.Models\Alpha.Models.csproj" />
        <ProjectReference Include="..\Alpha.Services\Alpha.Services.csproj" />
      </ItemGroup>
    
      <ItemGroup>
       <!-- ...-->
      </ItemGroup>
    
      <ItemGroup>
       <!-- ...-->
      </ItemGroup>
    
    </Project>
    
    0 回复  |  直到 4 年前
        1
  •  1
  •   janw arman aramesh    4 年前

    我已经删除了 Pomelo.EntityFrameworkCore.MySql 现在它工作得很好。 目前还没有兼容的Pomelo软件包。净值5:

    https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#schedule-and-roadmap

        2
  •  0
  •   milpataki    4 年前

    只需安装一个新的兼容Pomelo软件包。

    Pomelo.EntityFrameworkCore.MySql (v5.0.0) 实际上与 Microsoft.EntityFrameworkCore.Relational (v5.0.x)