Skip to content

Version

lordmilko edited this page Jul 13, 2021 · 6 revisions

To prevent discrepancies between development and published versions, PrtgAPI controls the version of builds via the source files uploaded to the repository.

When PrtgAPI is built in the Release configuration, the Set-PrtgVersion/Update-PrtgVersion cmdlets are used to update the following files

  • build\Version.props
  • src\PrtgAPI\Properties\Version.cs
  • src\PrtgAPI.PowerShell\PowerShell\Resources\PrtgAPI.psd1

Version.props

Version.props controls the version that is used when generating NuPkg packages

Version.cs

Version.cs is used to control

  • the version of PrtgAPI.dll that is visible within Windows Explorer (AssemblyFileVersion attribute). Uses all four digits of the version definition
  • the version of PrtgAPI.dll visible to other .NET assemblies. (AssemblyVersion attribute). Uses the first two digits of the version (major, minor)
  • the version that is displayed in PowerShell, indicating whether this is a pre-release/preview version or not (AssemblyInformationalVersion attribute)

PrtgAPI.psd1

PrtgAPI.psd1 controls the version of PrtgAPI that is displayed within PowerShell. PrtgAPI.psd1 uses the first three digits of the version (major, minor, build). It is critical the PrtgAPI.psd1 version match the NuGet version; otherwise, PowerShell will not be able to detect the module when installed under the Program Files\WindowsPowerShell\Modules path.

Clone this wiki locally