How to Automate Versioning with an AssemblyInfo Editor

Written by

in

Managing assembly metadata (AssemblyInfo.cs or SDK-style .csproj fields) is critical for versioning, continuous integration, and build automation. The top AssemblyInfo editor tools for .NET developers include native integrated development environments (IDEs), dedicated CI/CD extensions, and command-line automation scripts. While traditional standalone GUI editors have largely been replaced by modern SDK-style project properties, developers use specialized tools to dynamically patch versions during automated builds.

Here are the top 5 tools and approaches used by .NET developers to edit AssemblyInfo: 1. Visual Studio (Native Project Properties)

The most direct and widely used graphical interface for editing assembly information is built directly into Microsoft’s flagship IDE.

How it works: For legacy .NET Framework projects, opening Project Properties > Application > Assembly Information provides a dedicated dialog box to modify the title, description, company, product, copyright, and version numbers. For modern .NET SDK-style projects, these attributes are directly mapped to fields in the Project Properties > Package menu, which auto-generates the assembly metadata during compilation.

Best for: Developers who prefer a GUI and want to update metadata manually during local development. 2. GitVersion (CLI Automation)

GitVersion is an open-source tool that solves the problem of semantic versioning by calculating the version number based on your Git history.

How it works: Running the command GitVersion.exe /updateassemblyinfo will recursively search your repository for AssemblyInfo.cs or AssemblyInfo.vb files and patch them automatically. It updates AssemblyVersion to your semantic version and AssemblyInformationalVersion with the exact commit SHA-1 hash to ensure total traceability.

Best for: Teams practicing DevOps who want completely automated, deterministic versioning tied directly to Git tags and branches. 3. TeamCity AssemblyInfo Patcher (CI/CD Build Feature)

For enterprise environments using JetBrains’ build management platform, the native TeamCity AssemblyInfo Patcher handles version injection without writing any code.

How it works: You add this feature to your build configuration via the web UI and define your desired version format (using TeamCity system build parameters). Right before the build step executes, TeamCity automatically scans the workspace, checks out the files, and overwrites the version attributes across .cs, .vb, .fs, and .cpp files.

Best for: Developers using JetBrains ecosystems who want to decouple versioning logic from their codebase or repository scripts. 4. MSBuild Community Tasks (AssemblyInfo Task)

The MSBuild Community Tasks project is a classic, open-source library that provides hundreds of automation targets for MSBuild.

How it works: It includes a dedicated task that can be defined directly inside your .csproj or custom build targets. This task allows you to generate or overwrite a temporary or global AssemblyInfo.cs file every time a build is triggered, dynamically passing variables like build numbers, dates, and user credentials into the file attributes.

Best for: Legacy .NET Framework solutions or complex build pipelines where customization via code-driven build scripts is required. 5. Azure DevOps / VS Marketplace AssemblyInfo Tasks

For modern cloud-based automation pipelines, developers rely heavily on extension marketplace tasks, such as the widely adopted Update AssemblyInfo task by Sebastian Lux.

How it works: Deployed as a visual drag-and-drop step early in your Azure Pipelines yaml definition, it searches recursively for custom file patterns (e.g., *AssemblyInfo.cs). It then injects pipeline environment variables (like $(Build.BuildNumber)) into selected fields while leaving unconfigured fields intact.

Best for: Teams hosting their repositories and CI/CD pipelines in Azure DevOps. 10 Essential .NET Development Tools – Digisoft Solution

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *