D20Tek.MinimalApi.DevView 1.0.4

dotnet add package D20Tek.MinimalApi.DevView --version 1.0.4
                    
NuGet\Install-Package D20Tek.MinimalApi.DevView -Version 1.0.4
                    
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="D20Tek.MinimalApi.DevView" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="D20Tek.MinimalApi.DevView" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="D20Tek.MinimalApi.DevView" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add D20Tek.MinimalApi.DevView --version 1.0.4
                    
#r "nuget: D20Tek.MinimalApi.DevView, 1.0.4"
                    
#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.
#:package D20Tek.MinimalApi.DevView@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=D20Tek.MinimalApi.DevView&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=D20Tek.MinimalApi.DevView&version=1.0.4
                    
Install as a Cake Tool

MinimalApi-DevView

Introduction

MinimalApi.DevView is a lightweight, zero-config diagnostic toolkit for .NET Minimal API projects. Designed for development-time use, it provides runtime insights into your app’s metadata, routes, and requests — all accessible via a simple /dev endpoint. It's like a plug-and-play developer control panel for Minimal APIs.

Features

  • /dev/info – App metadata: environment, version, uptime, etc.
  • /dev/routes – Lists all mapped endpoints and their handlers
  • Request/response logging – Method, path, status code, and duration
  • Auto-disabled in production
  • Fully configurable base path and options in your MinimalApi app.config file

Installation

Install via NuGet:

PM > Install-Package D20Tek.MinimalApi.DevView --version 1.0.4

To install in the Visual Studio UI, go to the Tools menu > "Manage NuGet Packages". Then search for D20Tek.MinimalApi.DevView, and install whichever package version you require from there.

Usage

In your Program.cs, enable MinimalApi.DevView only in development:

using D20Tek.MinimalApi.DevView;
...

builder.Services.AddDevView(builder.Configuration);
...

if (app.Environment.IsDevelopment())
{
    app.UseDevView();
}

This automatically:

  • Maps /dev/info and /dev/routes
  • Adds middleware for request/response logging
  • Reads configuration from DI and environment
  • Will not leak internal diagnostics in production or staging environments unless explicitly configured

You can override the default settings via appsettings.Development.json in your MinimalApi project:

{
  "DevView": {
    "BasePath": "/my-dev",
    "LogLevel": "Information"
  }
}

Endpoints

With DevView added, your MinimalApi project will now have two additional routes when you run the service. These routes are available to help you understand your service Api.

/dev/info - returns app metadata:

{
  "AppName": "MyApi",
  "Environment": "Development",
  "Version": "1.0.0",
  "StartTime": "2025-05-20T12:34:56Z",
  "UptimeSeconds": 132
}

/dev/routes - lists all mapped Minimal API endpoints:

[
  {
    "Method": "GET",
    "Pattern": "/users/{id}",
    "Handler": "UserEndpoints.GetById",
    "Produces": [ "application/json" ]
  },
  {
    "Method": "POST",
    "Pattern": "/auth/login",
    "Handler": "AuthEndpoints.Login"
  }
]

/dev/deps - lists all services registered with the WebApi dependency injection container:

[
  {
    "serviceType": "IHostingEnvironment",
    "implementation": "Microsoft.Extensions.Hosting.Internal.HostingEnvironment",
    "lifetime": "Singleton",
    "assemblyName": "Microsoft.Extensions.Hosting"
  },
  {
    "serviceType": "IHostEnvironment",
    "implementation": "Microsoft.Extensions.Hosting.Internal.HostingEnvironment",
    "lifetime": "Singleton",
    "assemblyName": "Microsoft.Extensions.Hosting"
  },
  {
    "serviceType": "HostBuilderContext",
    "implementation": "Microsoft.Extensions.Hosting.HostBuilderContext",
    "lifetime": "Singleton",
    "assemblyName": "Microsoft.Extensions.Hosting.Abstractions"
  },
  ...
]

/dev/config - lists all configuration settings available to your WebApi (with their source provider):

{
  "summary": {
    "environmentName": "Development",
    "loadedJsonFiles": [
      "appsettings.json",
      "appsettings.Development.json"
    ],
    "providers": [
      {
        "name": "Appsettings (appsettings.Development.json)",
        "providedKeys": 5
      },
      {
        "name": "Appsettings (appsettings.json)",
        "providedKeys": 2
      },
      {
        "name": "ChainedConfigurationProvider",
        "providedKeys": 2
      },
      {
        "name": "Environment Variable",
        "providedKeys": 10
      },
      {
        "name": "In-Memory",
        "providedKeys": 1
      }
    ],
    "effectiveUrls": [
      "https://localhost:7211",
      "http://localhost:5294"
    ]
  },
  "configDetails": [
    {
      "key": "Logging:LogLevel:Default",
      "value": "Information",
      "source": "Appsettings (appsettings.Development.json)",
      "isSensitive": false,
      "valueType": "string"
    },
    {
      "key": "Logging:LogLevel:Microsoft.AspNetCore",
      "value": "Warning",
      "source": "Appsettings (appsettings.Development.json)",
      "isSensitive": false,
      "valueType": "string"
    },
    {
      "key": "AllowedHosts",
      "value": "*",
      "source": "Appsettings (appsettings.json)",
      "isSensitive": false,
      "valueType": "string"
    },
    {
      "key": "ConnectionStrings:DefaultConnection",
      "value": "*****",
      "source": "Appsettings (appsettings.json)",
      "isSensitive": true,
      "valueType": "string"
    },
    ...
  ]
}

Logging

By default, DevView registers a request/response logger to help with debugging your service. The logging output looks like this:

--> GET /users/5
<-- 200 OK (112ms)

Samples

For more detailed examples on how to use D20Tek.MinimalApi.DevView, please review the following samples:

  • Sample.WebApi - A simple Minimal WepApi project that implements the necessary calls to MinimalApi.DevView. This service has endpoints for weather forecasts and task CRUD operations.

Feedback

If you use this library and have any feedback, bugs, or suggestions, please file them in the Issues section of this repository. I'm still in the process of building the library and samples, so any suggestions that would make it more useable are welcome.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in 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.4 131 7/7/2025
1.0.3 137 6/4/2025
1.0.2 145 5/26/2025
1.0.1 126 5/23/2025