dotnet包最近失败

如何解决dotnet包最近失败

我们在Azure Devops中已经很长时间收到NU5118错误,但是打包步骤正在通过

Starting: Pack
==============================================================================
Task         : .NET Core
Description  : Build,test,package,or publish a dotnet application,or run a custom dotnet command
Version      : 2.167.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
==============================================================================
C:\windows\system32\chcp.com 65001
Active code page: 65001
e:\vsts\a\_tool\dotnet\dotnet.exe pack e:\vsts\a\4674\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj --configuration Release -o e:\vsts\a\4674\a/nuget /p:Version=1.0.86.0 --no-build --no-restore
Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

e:\vsts\a\_tool\dotnet\sdk\3.1.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error NU5118: File 'C:\Users\prgremotebuilder\.nuget\packages\bentley.interoperability.identityservice.oracle\1.0.69\contentFiles\any\netstandard2.0\scripts\oracle\Create-Identity.sql' is not added because the package already contains file 'content\Create-Identity.sql' [e:\vsts\a\4674\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj]
e:\vsts\a\_tool\dotnet\sdk\3.1.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error NU5118: File 'C:\Users\prgremotebuilder\.nuget\packages\bentley.interoperability.identityservice.oracle\1.0.69\contentFiles\any\netstandard2.0\scripts\oracle\Create-Identity.sql' is not added because the package already contains file 'contentFiles\any\netstandard2.1\Create-Identity.sql' [e:\vsts\a\4674\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj]
e:\vsts\a\_tool\dotnet\sdk\3.1.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error NU5118: File 'C:\Users\prgremotebuilder\.nuget\packages\bentley.interoperability.identityservice.oracle\1.0.69\contentFiles\any\netstandard2.0\scripts\oracle\Identity-SP.sql' is not added because the package already contains file 'content\Identity-SP.sql' [e:\vsts\a\4674\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj]
e:\vsts\a\_tool\dotnet\sdk\3.1.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error NU5118: File 'C:\Users\prgremotebuilder\.nuget\packages\bentley.interoperability.identityservice.oracle\1.0.69\contentFiles\any\netstandard2.0\scripts\oracle\Identity-SP.sql' is not added because the package already contains file 'contentFiles\any\netstandard2.1\Identity-SP.sql' [e:\vsts\a\4674\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj]
  Successfully created package 'e:\vsts\a\4674\a\nuget\Bentley.Interoperability.APM.1.0.86.nupkg'.
Info: Azure Pipelines hosted agents have been updated to contain .Net Core 3.x (3.0 and 3.1) SDK/Runtime along with 2.1. Unless you have locked down a SDK version for your project(s),3.x SDK might be picked up which might have breaking behavior as compared to previous versions. 
Some commonly encountered changes are: 
If you're using `Publish` command with -o or --Output argument,you will see that the output folder is now being created at root directory rather than Project File's directory. To learn about more such changes and troubleshoot,refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
Finishing: Pack

但是现在失败了:

它具有相同的错误消息,但现在还具有“ Dotnet命令失败,并且以下项目上的退出代码为非零...”

Starting: Nuget: Pack
==============================================================================
Task         : .NET Core
Description  : Build,or run a custom dotnet command
Version      : 2.173.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
==============================================================================
C:\windows\system32\chcp.com 65001
Active code page: 65001
Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents,kindly upgrade to newer versions which are not EOL,or else use UseDotNet task to install the required version.
e:\vsts\b\_tool\dotnet\dotnet.exe pack e:\vsts\b\6232\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj --configuration Release -o e:\vsts\b\6232\a/nuget /p:Version=1.0.244.0 --no-build
Microsoft (R) Build Engine version 16.7.0-preview-20360-03+188921e2f for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

e:\vsts\b\_tool\dotnet\sdk\3.1.401\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error NU5118: File 'C:\Users\prgremotebuilder\.nuget\packages\bentley.interoperability.identityservice.oracle\1.0.69\contentFiles\any\netstandard2.0\scripts\oracle\Create-Identity.sql' is not added because the package already contains file 'content\Create-Identity.sql' [e:\vsts\b\6232\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj]
e:\vsts\b\_tool\dotnet\sdk\3.1.401\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error NU5118: File 'C:\Users\prgremotebuilder\.nuget\packages\bentley.interoperability.identityservice.oracle\1.0.69\contentFiles\any\netstandard2.0\scripts\oracle\Create-Identity.sql' is not added because the package already contains file 'contentFiles\any\netstandard2.1\Create-Identity.sql' [e:\vsts\b\6232\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj]
e:\vsts\b\_tool\dotnet\sdk\3.1.401\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error NU5118: File 'C:\Users\prgremotebuilder\.nuget\packages\bentley.interoperability.identityservice.oracle\1.0.69\contentFiles\any\netstandard2.0\scripts\oracle\Identity-SP.sql' is not added because the package already contains file 'content\Identity-SP.sql' [e:\vsts\b\6232\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj]
e:\vsts\b\_tool\dotnet\sdk\3.1.401\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error NU5118: File 'C:\Users\prgremotebuilder\.nuget\packages\bentley.interoperability.identityservice.oracle\1.0.69\contentFiles\any\netstandard2.0\scripts\oracle\Identity-SP.sql' is not added because the package already contains file 'contentFiles\any\netstandard2.1\Identity-SP.sql' [e:\vsts\b\6232\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj]
##[error]Error: The process 'e:\vsts\b\_tool\dotnet\dotnet.exe' failed with exit code 1
Info: Azure Pipelines hosted agents have been updated to contain .Net Core 3.x (3.1) SDK/Runtime along with 2.1. Unless you have locked down a SDK version for your project(s),refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Dotnet command failed with non-zero exit code on the following projects : e:\vsts\b\6232\s\src\Bentley.Interoperability.APM\Bentley.Interoperability.APM.csproj
Finishing: Nuget: Pack

解决方法

我可以确认我们已经看到了完全相同的行为,没有对我们的构建管道或源代码进行任何更改。第一个失败的构建在任务日志顶部的横幅中也有Version : 2.173.0

在我们的例子中,该错误是由于多个相关的nuget软件包所致,这些软件包都包含一个.targets文件,其元素为:

<Content Include="Deployment\**\*.*" Pack="true" PackagePath="\..\Deployment\" />

该错误一直记录在任务中,只有以前的版本忽略了该错误并仍然通过了构建。由于nuget pack尽管出现错误,仍会发出.nupkg文件,所以此方法有效。

我们的解决方法是在包含之前添加一个Remove元素:

<Content Remove="Deployment\**\*.*" />
<Content Include="Deployment\**\*.*" Pack="true" PackagePath="\..\Deployment\" />
,

您提供的日志显示错误发生的原因是您的.NET Core SDK /运行时版本太旧。

推荐的解决方案是在原始任务之前添加一个UseDotNet任务:

- task: UseDotNet@2
  inputs:
    version: {version}

您也可以将自托管代理与所需的.NET Core SDK /运行时版本一起使用,而不是托管代理,也可以使用更新的版本。但是这两种解决方案都会极大地改变建筑环境,因此需要根据您的情况谨慎使用。

,

dotnet包最近失败

根据错误消息:

错误NU5118:未添加文件'Create-Identity.sql',因为 程序包已经包含文件'content \ Create-Identity.sql'

似乎您在项目中拥有let bar = new ProgressBar.SemiCircle(npsbar,{ strokeWidth: 10,easing: 'easeInOut',duration: 1400,color: 'tomato',trailColor: '#eee',trailWidth: 1,svgStyle: null }); bar.trail.setAttribute('stroke-linecap','round'); bar.path.setAttribute('stroke-linecap','round'); bar.animate(0.8); ,并且有多个文件具有相同的文件名。那就是说包裹已经包含文件的原因。

要解决此问题,最简单的方法是删除同一文件或在可能的情况下重命名它们。

如果我们无法删除或重命名这些文件,则可以尝试将IncludeSource=true文件与其他文件放在不同的目标路径中。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-