BuildDateTimeGenerator 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package BuildDateTimeGenerator --version 1.0.0                
NuGet\Install-Package BuildDateTimeGenerator -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BuildDateTimeGenerator" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BuildDateTimeGenerator --version 1.0.0                
#r "nuget: BuildDateTimeGenerator, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BuildDateTimeGenerator as a Cake Addin
#addin nuget:?package=BuildDateTimeGenerator&version=1.0.0

// Install BuildDateTimeGenerator as a Cake Tool
#tool nuget:?package=BuildDateTimeGenerator&version=1.0.0                

BuildDateTime Generator

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 way the property is accessible depends on the project:

1. Main() style entry point application The property is added to the class that contains the Main() method. The class must be marked as partial.

<pre><code>namespace ApplicationNamespace { internal <i>partial</i> class Program { private static void Main () { Console.WriteLine( <b>BuildDateTime</b> ); } } }</code></pre>

2. Top-level entry point application The property is added to the top-level of the application. The usage is straightforward:

<pre><code>Console.WriteLine( <b>BuildDateTime</b> );</code></pre>

3. Class library The property is added to a new class BuildDateTimeClass in the default namespace of the library.

<pre><code>namespace ClassLibrary { using System;

public class Class { public static DateTimeOffset BuildDateTimeUsage { get; } = <b>BuildDateTimeClass.BuildDateTime</b>; } }</code></pre>

📝 Because the value of the BuildDateTime property varies from build to build, the Deterministic option, if set, is violated.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 138 2/10/2024
1.0.0 165 2/9/2024