【发布时间】:2021-12-28 09:20:06
【问题描述】:
由于设置构建管道直观且方便,我无法弄清楚如何在构建后创建一个 nuget 包。我没有使用 .yml。 项目是 .Net Core 5。
这是日志:
System.IO.IOException: The process cannot access the file 'D:\a\1\s\Package\SomeCompanyPackages.0.0.1.nupkg' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
Id: SomeCompanyPackages
at System.IO.File.InternalDelete(String path, Boolean checkHost)
Version: 0.0.1
at NuGet.Commands.PackCommandRunner.BuildPackage(PackageBuilder builder, String outputPath, Boolean symbolsPackage)
Authors: VssAdministrator
at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
Description: Description
at NuGet.CommandLine.PackCommand.ExecuteCommand()
Dependencies:
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
Added file '[Content_Types].xml'.
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
Added file '_rels/.rels'.
Added file 'SomeCompanyPackages.nuspec'.
Added file 'lib/net5.0/SomeCompanyPackages.dll'.
Added file 'package/services/metadata/core-properties/d9f19903a89841ee8740535a9eba2337.psmdcp'.
##[error]The nuget command failed with exit code(1) and error(Error NU5115: Description was not specified. Using 'Description'.
Error NU5115: Author was not specified. Using 'VssAdministrator'.
Error NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. Consult the list of actions below:
- Add a dependency group for net5.0 to the nuspec
The process cannot access the file 'D:\a\1\s\Package\SomeCompanyPackages.0.0.1.nupkg' because it is being used by another process.
System.IO.IOException: The process cannot access the file 'D:\a\1\s\Package\SomeCompanyPackages.0.0.1.nupkg' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at NuGet.Commands.PackCommandRunner.BuildPackage(PackageBuilder builder, String outputPath, Boolean symbolsPackage)
at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
at NuGet.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args))
##[error]An error occurred while trying to pack the files.
Finishing: NuGet pack
更新: 刚刚发现还有另一种(更新的)方法来打包 nu get 包。 https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops 不幸的是,这似乎仅适用于 yml 配置。 如何将此添加到我的配置中?代理的任务库中没有 .NET Core CLI 任务。
【问题讨论】:
-
有,但我认为你找错了名字。该任务称为“.NET Core”,而不是“.NET Core CLI”
标签: azure-devops azure-pipelines nuget-package