Problem

The user is facing issues with the package version in .NET core project. User have configured version in assemblyfileversion and assemblyversion property of /Properties/AssemblyInfo.cs file but when user create nuget package using “dotnet pack” command package is generated with “*.1.0.0.nupkg”

Cause

The user was assigning version to the property in assembly information file, .NET framework was using the file and property to assign assembly version but .NET core uses version property from project.csproj file.

Resolution

  • For .NET core we need to set properties in project.csproject file where we need to set value in VersionPrefix and VersionSuffix properties.
  • <PropertyGroup> <VersionPrefix>2.0.0</VersionPrefix>
    <VersionSuffix>alpha</VersionSuffix> </PropertyGroup>
  • We can also set it using version property in project.csproject file.
  •  2.0.0-alpha 

Support On Demand!

.Net