Source generator for embedding build information as compile time constants in C# projects.
Add the following to your project file:
<ItemGroup>
<PackageReference Include="Credfeto.Version.Information.Generator" Version="1.0.2.16" PrivateAssets="All"
ExcludeAssets="runtime"/>
</ItemGroup>This generates a class called VersionInformation in the root namespace of the project with the following properties
taken from properties in the project file:
internal static class VersionInformation
{
public const string Version = "0.0.0.1-test";
public const string Product = "Credfeto.Version.Information.Example.Tests";
public const string Company = "Example Company";
public const string Copyright = "Copyright © Example Company 2024";
}Controlled by the following properties:
<PropertyGroup>
<Company>Example Company</Company>
<Copyright>Copyright © Example Company 2024</Copyright>
</PropertyGroup>- Version comes from the
AssemblyInformationalVersionthat can be set using the/p:Version=0.0.1-testcommand line argument to MSBuild. or a<Version>property in the project file. - Product comes from the Root Namespace property for the assembly.
| Branch | Status |
|---|---|
| main | |
| release |
View changelog