LinkDotNet.BuildInformation 0.4.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package LinkDotNet.BuildInformation --version 0.4.2                
NuGet\Install-Package LinkDotNet.BuildInformation -Version 0.4.2                
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="LinkDotNet.BuildInformation" Version="0.4.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LinkDotNet.BuildInformation --version 0.4.2                
#r "nuget: LinkDotNet.BuildInformation, 0.4.2"                
#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 LinkDotNet.BuildInformation as a Cake Addin
#addin nuget:?package=LinkDotNet.BuildInformation&version=0.4.2

// Install LinkDotNet.BuildInformation as a Cake Tool
#tool nuget:?package=LinkDotNet.BuildInformation&version=0.4.2                

Incremental Build Information Generator

.NET Nuget GitHub tag

This project provides a simple and easy-to-use C# source generator that embeds build information, such as the build time, platform, warning level, and configuration, directly into your code. By using the BuildInformation class, you can quickly access and display these details.

Features

  • Embeds build date (in UTC) in your code
  • Embeds platform (AnyCPU, x86, x64, ...) information in your code
  • Embeds compiler warning level in your code
  • Embeds build configuration (e.g., Debug, Release) in your code
  • Embeds the assembly version and assembly file version in your code
  • Embeds the target framework moniker in your code
  • Embeds the nullability analysis level in your code
  • Embeds the deterministic build flag in your code

Usage

To use the BuildInformation class in your project, add the NuGet package:

dotnet add package LinkDotNet.BuildInformation

Here is some code how to use the class:

using System;

Console.WriteLine($"Build at: {BuildInformation.BuildAt}");
Console.WriteLine($"Platform: {BuildInformation.Platform}");
Console.WriteLine($"Warning level: {BuildInformation.WarningLevel}");
Console.WriteLine($"Configuration: {BuildInformation.Configuration}");
Console.WriteLine($"Assembly version: {BuildInformation.AssemblyVersion}");
Console.WriteLine($"Assembly file version: {BuildInformation.AssemblyFileVersion}");
Console.WriteLine($"Assembly name: {BuildInformation.AssemblyName}");
Console.WriteLine($"Target framework moniker: {BuildInformation.TargetFrameworkMoniker}");
Console.WriteLine($"Nullability level: {BuildInformation.Nullability}");
Console.WriteLine($"Deterministic build: {BuildInformation.Deterministic}");

You can also hover over the properties to get the currently held value (xmldoc support). An example output could look like this:

Build at: 24.03.2023 21:32:17
Platform: AnyCpu
Warning level: 7
Configuration: Debug
Assembly version: 1.0
Assembly file version: 1.2
Assembly name: LinkDotNet.BuildInformation.Sample
Target framework moniker: net7.0
Nullability level: enabled
Deterministic build: true

Contributing

If you would like to contribute to the project, please submit a pull request or open an issue on the project's GitHub page. We welcome any feedback, bug reports, or feature requests.

License

This project is licensed under the MIT License.

There are no supported framework assets in this package.

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.

Version Downloads Last updated
1.3.0 118 10/11/2024
1.2.1 3,877 5/2/2024
1.2.0 2,144 4/25/2024
1.1.2 983 4/20/2024
1.1.1 105 4/19/2024
1.0.0 3,917 12/30/2023
0.4.2 6,013 8/29/2023
0.4.1 1,305 8/12/2023
0.4.0 1,109 6/15/2023
0.3.0 4,621 3/24/2023
0.1.0 1,293 3/24/2023