BuildDateTimeGeneratorAlt 2.0.1
dotnet add package BuildDateTimeGeneratorAlt --version 2.0.1
NuGet\Install-Package BuildDateTimeGeneratorAlt -Version 2.0.1
<PackageReference Include="BuildDateTimeGeneratorAlt" Version="2.0.1" />
<PackageVersion Include="BuildDateTimeGeneratorAlt" Version="2.0.1" />
<PackageReference Include="BuildDateTimeGeneratorAlt" />
paket add BuildDateTimeGeneratorAlt --version 2.0.1
#r "nuget: BuildDateTimeGeneratorAlt, 2.0.1"
#:package BuildDateTimeGeneratorAlt@2.0.1
#addin nuget:?package=BuildDateTimeGeneratorAlt&version=2.0.1
#tool nuget:?package=BuildDateTimeGeneratorAlt&version=2.0.1
BuildDateTime Generator (Alternate)
This simple C# source code generator adds the DateTimeOffset BuildDateTime { get; } property to the compiled project. The property gets the DateTimeOffset value which is set to the date and time the project was built.
The property is added to a new class BuildDateTimeClass in the default namespace of the library.
namespace ClassLibrary
{
using System;
public class Class
{
public static DateTimeOffset BuildDateTimeUsage { get; } = BuildDateTimeClass.BuildDateTime;
}
}
📝 Because the value of the
BuildDateTimeproperty varies from build to build, the Deterministic option, if set, is violated.
This code was adapted from the BuildDateTime generator and modified to work with apps that generate Program.cs
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.