AssemblyAttribute 1.0.1

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

// Install AssemblyAttribute as a Cake Tool
#tool nuget:?package=AssemblyAttribute&version=1.0.1


Reusable base attribute designed to streamline the process of using auto-versioning scripts in C# project files.


The BaseAssemblyAttribute abstract class accepts any number of strings via params string[], but since it is an abstract class it cannot be used directly.
You can use it to create your own assembly attributes, or just as example code - the implementation is very simple.


Derives from BaseAssemblyAttribute and acts as a method to retrieve the full version string and an array of its segments after being split by all occurrences of ., -, or + via the ExtendedVersionAttribute.Version and ExtendedVersionAttribute.VersionSegments properties, respectively.
I use it with my auto-versioning scripts so I can retrieve the latest git tag in the local repository directly in the code, and that's what this guide will focus on.

  1. Add the AssemblyAttribute( nuget package) to your project.
  2. Open the .csproj project file in the editor.
    For .NET Core projects, you can do this by Right-Clicking on the project in the solution explorer & selecting the Edit Project File option.
  3. Add an element within the PropertyGroup tag to store the version number:
  4. Add a new ItemGroup element within the Project tag to add the attribute to that assembly, and pass in the value of the PropertyGroup variable from the previous step:
      <AssemblyAttribute Include="AssemblyAttribute.ExtendedVersion">
  5. You can now retrieve the ExtendedVersionAttribute with the properties you passed in the csproj file in your code with:
    //                         ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
    //  Adapt as needed to get the assembly that corresponds to your csproj file!

Now all you have to do is update the version number in your csproj file before *(re)building the solution somewhere in your build script (This example uses PowerShell):
```ps1 [xml]$CONTENT = Get-Content -Path "<YOUR_CSPROJ_FILE_PATH_HERE>" $CONTENT.Project.PropertyGroup.ExtendedVersion = git describe --tags --abbrev=0

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on AssemblyAttribute:

Package Downloads

Windows Input Simulator fork for .NET Standard 2.1 licensed under MIT. The Windows Input Simulator provides a simple .NET (C#) interface to simulate Keyboard or Mouse input using the Win32 SendInput method. All of the Interop is done for you and there's a simple programming model for sending multiple keystrokes.


WPF behavior that updates data bindings on a timer, entirely from XAML.


Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 1,267 12/22/2022
1.0.1 598 10/25/2022
0.0.0 588 5/16/2022