BuildMaster Documentation

.net - Set Project Version

  • Last Modified: 2020-06-26

This is generated from the built-in components of BuildMaster 6.2.13, 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:

Name Format Script Usage Usage 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
);

Is this documentation incorrect or incomplete? Help us by contributing!

This documentation is licensed under CC-BY-SA-4.0 and stored in GitHub.

Generated from commit ced119d5 on master