I am using Nuget Packager task step to get the nupkg file out of my csproj, and my .nuspec file contains the version number:
<version>1.1.2<version>
However, the resulting file only contains my build name, and has random numbers attached to it. For instance: MyProject.0.0.7416.19926.nupkg.
Automatic Package versioning option is turned off because I assumed the version would be used from the .nuspec file. I've also included YAML definition for the Nuget packager.
{
"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"
}
}
I'm using a new version for nugget.exe thats why the path in nuGetPath.
