【发布时间】:2020-08-04 12:31:22
【问题描述】:
我正在使用 Nuget Packager 任务步骤从我的 csproj 中获取 nupkg 文件,并且我的 .nuspec 文件包含版本号:
<version>1.1.2<version>
但是,生成的文件仅包含我的构建名称,并附有随机数。 例如:MyProject.0.0.7416.19926.nupkg。
自动包版本控制选项已关闭,因为我假设将使用 .nuspec 文件中的版本。 我还包含了 Nuget 打包程序的 YAML 定义。
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "NuGet Packager ",
"timeoutInMinutes": 0,
"condition": "succeeded()",
"task": {
"id": "333b11bd-d341-40d9-afcf-b32d5ce6f24b",
"versionSpec": "0.*",
"definitionType": "task"
},
"inputs": {
"searchPattern": "$/...csproj",
"outputdir": "$(Build.StagingDirectory)\\packages",
"includeReferencedProjects": "false",
"versionByBuild": "false",
"versionEnvVar": "Version",
"requestedMajorVersion": "1",
"requestedMinorVersion": "0",
"requestedPatchVersion": "0",
"configurationToPack": "$(BuildConfiguration)",
"buildProperties": "",
"nuGetAdditionalArgs": "",
"nuGetPath": "$(System.DefaultWorkingDirectory)\\build\\nuget.exe"
}
}
我正在为 nugget.exe 使用新版本,这就是为什么 nuGetPath 中的路径。
【问题讨论】:
-
你能添加你的 YAML 定义吗?
-
@KrzysztofMadej 完成
-
您的项目类型是什么? .net 核心?还是 .net 框架?
标签: azure-devops nuget azure-pipelines-build-task