Logo

dev-resources.site

for different kinds of informations.

AspNetCore.VersionInfo 1.1.0 is out

Published at
3/10/2023
Categories
dotnet
nuget
library
github
Author
giorgiolasala
Categories
4 categories in total
dotnet
open
nuget
open
library
open
github
open
Author
13 person written this
giorgiolasala
open
AspNetCore.VersionInfo 1.1.0 is out

AspNetCore.VersionInfo is a NuGet library that provides a simple and effective way to obtain information about the version of the running ASP.NET Core application. This library can be used for various purposes, such as displaying the version on your web application or the list of referenced assemblies.
This library targets .NET 6 and is easy to install and configure in an existing ASP.NET Web Application.

After installing the NuGet package, it is sufficient to add the VersionInfo middleware to the application's middleware pipeline in the Configure and ConfigureServices method of the Startup object:

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddVersionInfo()
            .With<ClrVersionProvider>()
            .With<AssemblyVersionProvider>();
    }

    public void Configure(IApplicationBuilder app)
    {
        app.UseRouting();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapVersionInfo();
        });
    }
}
Enter fullscreen mode Exit fullscreen mode

Once configured, the library will provide information about the application version through different endpoints; in particular there are 3 endpoints:

  • /version/json -> will return a JSON object
  • /version/html -> will return an HTML user-friendly page
  • /version/badge -> a nice and highly configurable badge image

Using this library has several advantages over manually implementing the application version. Firstly, the library provides a standardized way of obtaining information about the application version with a few lines of code, using built-in providers.

Additionally, the library provides a high level of configurability, allowing for customization of both the collected information and UI visualization (such as badge color and icons).

More information and samples are available on GitHub repository.

I'd love to know what your opinion!

nuget Article's
30 articles in total
Favicon
Simplifying Dependency Management with NuGet Central Package Management
Favicon
Failed to access Nuget in China
Favicon
Seu Primeiro Pacote NuGet: Um Passo a Passo Prático
Favicon
Central Package Management in .NET - Simplify NuGet Dependencies
Favicon
Custom NET8 Entity Framework Core Generic Repository
Favicon
How to publish a package on Nuget.org
Favicon
Automate Your C# Library Deployment: Publishing to NuGet and GitHub Packages with GitHub Actions
Favicon
My First NuGet Package: EmojiToText
Favicon
Publish C# Project to Nuget.org
Favicon
My Very First NuGet package
Favicon
Introducing VirtualStorageLibrary: A .NET Solution for In-Memory Tree Structures
Favicon
C# | Create Nuget Package using .NET Standard
Favicon
GitHub | Deploy .net core NuGet Packages in GitHub Packages Registry
Favicon
CSV Schema Validation
Favicon
Publishing Nuget in GitHub Packages
Favicon
.NET MAUI: Update NuGet Packages using Visual Studio Code
Favicon
How I Built a NuGet Package
Favicon
Lee's opinions on Umbraco + naming things
Favicon
Migrating the XM Cloud Introduction Repo to a new Nuget feed.
Favicon
How This NuGet Package Almost Cost Me My Job
Favicon
How to create and deploy a “Nuget Package” using Visual Studio
Favicon
How to change default Nuget packages folder on Windows
Favicon
How to Make a NuGet Package for C++ Development in Visual Studio
Favicon
Data Validation Nuget Package
Favicon
Create a NuGet-Package
Favicon
AspNetCore.VersionInfo 1.1.0 is out
Favicon
Deploying NuGet packages with Docker in GitHub actions
Favicon
Introducing TF WhatsUp, a Tool for Better Terraform Notes
Favicon
Creating a Nuget Package From a .Net 6 class library
Favicon
Elasticsearch.Net vs NEST

Featured ones: