VietRoadie
VietRoadie

Reputation: 179

octopack nuget package version

My nupkg file seem to version 1.0.0.0 no matter what I did. I want to specify the version of the package using the version element inside my nuspec file as follow.

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
    <metadata>
        <id>SpacePlanning.SavePlanogram</id>
        <version>1.0.1</version>
        <authors>Blah</authors>
    </metadata>
..
</package>

My msbuild command is

MSBuild.exe "%WORKSPACE%\LoadPlanogram.sln" /t:Build /p:Configuration=Debug /p:OctopusPackageConfiguration=Debug /p:RunOctoPack=true /p:OctoPackEnforceAddingFiles=true /p:OctopusPackageVersion=1.0.0

Upvotes: 1

Views: 525

Answers (1)

Emiel Koning
Emiel Koning

Reputation: 4225

The MSBuild parameter you're looking for is OctoPackPackageVersion, not OctopusPackageVersion.

I believe that what you're asking (specify a hardcoded version in the .nuspec file and use that) is not possible.

You can choose to specify the version through the MSBuild parameter mentioned above, or in the AssemblyInfo.cs file, using the AssemblyInformationalVersionAttribute or AssemblyVersionAttribute.

[assembly: AssemblyVersion("1.0.1")]

or, if you want to create a pre-release package:

[assembly: AssemblyInformationalVersion("1.2.3-myhotfix+somemetadata")]

You can read about the inner workings of OctoPack when it comes to versioning the package here: Using OctoPack Versioning

Upvotes: 1

Related Questions