Set Project Version
  • 17 Feb 2022
  • 1 Minute to read
  • Dark
    Light
  • PDF

Set Project Version

  • Dark
    Light
  • PDF

Article Summary

This is generated from the built in components of BuildMaster 7.0.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] -> Documentation within your BuildMaster instance to see exactly what operations are available.

Set Project Version

Sets the version elements in .NET project files to a specified value.

Script usage:

DotNet::Set-ProjectVersion(
	[FromDirectory: <text>],
	Version: <text>,
	[Include: <@(text)>],
	[Exclude: <@(text)>],
	[AssemblyVersion: <text>],
	[FileVersion: <text>],
	[PackageVersion: <text>]
);

Arguments:

NameFormatScript UsageUsage Notes
From directory
text
FromDirectory
☆ Version
text
Version
 This argument is required.
Include
@(text)
Include
See KB#1119 to learn more about masking syntax.
Exclude
@(text)
Exclude
Assembly version
text
AssemblyVersion
File version
text
FileVersion
Package version
text
PackageVersion

Note: This operation is intended to be used when generating assembly info properties from a .NET project file. To set attributes in AssemblyInfo.cs, use DotNet::WriteAssemblyVersion.

Example:

# Build ~\src\MyProject.csproj with Release configuration, restoring NuGet packages from the InternalNuGet source
DotNet::SetProjectVersion
(
    Version: $ReleaseNumber,
    AssemblyVersion: $ReleaseNumber.0
    FileVersion: $ReleaseNumber.$BuildNumber
);

Was this article helpful?