zoukankan      html  css  js  c++  java
  • ASP.Net Core 3.1 发布错误 Error NU1605 解决方案

    编译都OK,发布就报错,错误提示检测到程序包降级,排查发现都是来自于 BofSoft.Data 项目引用的包 MySql.Data

    /*
    Error Detected package downgrade: System.Threading from 4.3.0 to 4.0.11. Reference the package directly from the project to select a different version. 
     BofSoft.Domain.Core -> BofSoft.Data -> MySql.Data 8.0.20 -> SSH.NET 2016.1.0 -> System.Net.Sockets 4.1.0 -> runtime.win.System.Net.Sockets 4.3.0 -> System.Threading (>= 4.3.0) 
     BofSoft.Domain.Core -> BofSoft.Data -> MySql.Data 8.0.20 -> SSH.NET 2016.1.0 -> System.Threading (>= 4.0.11)    BofSoft.Web.OpenApi
    D:XYZBofSoftBofSoft.Domain.CoreBofSoft.Domain.Core.csproj
    */

    在 BofSoft.Data 项目文件中指定所有出问题包的版本

    <ItemGroup>
        <PackageReference Include="Dapper" Version="2.0.35" />
        <PackageReference Include="MySql.Data" Version="8.0.20" />
        <!--
        发布项目时出现如下错误:
        Error NU1605: Detected package downgrade: System.IO.FileSystem.Primitives from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version.
        检测到包降级,原因是 MySql.Data 中引用的包版本与 .Net Core 3.1 中的不一致,因此在下面统一指定包的版本
        -->
        <PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" PrivateAssets="all" />
        <PackageReference Include="System.Globalization" Version="4.3.0" PrivateAssets="all" />
        <PackageReference Include="System.Net.Primitives" Version="4.3.0" PrivateAssets="all" />
        <PackageReference Include="System.Net.NameResolution" Version="4.3.0" PrivateAssets="all" />
        <PackageReference Include="System.IO.FileSystem" Version="4.3.0" PrivateAssets="all" />  
        <PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" PrivateAssets="all" />
        <PackageReference Include="System.Runtime.Extensions" Version="4.3.0" PrivateAssets="all" />
        <PackageReference Include="System.Threading" Version="4.3.0" PrivateAssets="all" />
      </ItemGroup>

    再次发布成功

  • 相关阅读:
    QTP实践总结
    webStorm快捷键大全
    linux下vi命令大全
    Oracle中查询各种对象的方法小结
    c#取出LDAP SearchResult所有属性
    Cool Edit Pro 2.0详细教程(转)
    移动端 触摸事件 ontouchstart、ontouchmove、ontouchend、ontouchcancel
    跨平台运行ASP.NET Core 1.0(转载)
    Linux下使用NMON监控、分析系统性能
    EAIntroView–高度可定制的iOS应用欢迎页通用解决方案
  • 原文地址:https://www.cnblogs.com/felixnet/p/13161034.html
Copyright © 2011-2022 走看看