Viaduct.Server 0.1.1

dotnet add package Viaduct.Server --version 0.1.1
                    
NuGet\Install-Package Viaduct.Server -Version 0.1.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="Viaduct.Server" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Viaduct.Server" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Viaduct.Server" />
                    
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 Viaduct.Server --version 0.1.1
                    
#r "nuget: Viaduct.Server, 0.1.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.
#:package Viaduct.Server@0.1.1
                    
#: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=Viaduct.Server&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Viaduct.Server&version=0.1.1
                    
Install as a Cake Tool

Viaduct.Server

Define your service interface once. Viaduct wires it to an ASP.NET Core server and a typed HTTP client — automatically, at compile time, with no duplication.

Viaduct.Server is the server-side package. It reads your interface at compile time and generates Minimal API endpoint handlers — no manual app.MapGet(...), no controllers, no boilerplate. The client project uses the same interface to generate a matching HTTP proxy, so both sides stay in sync automatically.


The single-source-of-truth model

┌─────────────────────────────────────────┐
│  Shared project (IUserService)          │
│  Define once. Change once. Done.        │
└────────────┬────────────────────────────┘
             │
             ▼
  ┌─────────────────────┐
  │  Your server project │  ← references Viaduct.Server
  │  (this package)      │
  │                      │
  │  AddScopedAndMap     │  → generates GET /users/GetUserAsync/{id}
  │  <IUserService,      │     generates POST /users/CreateUserAsync/...
  │   UserService>()     │
  └─────────────────────┘

Quick start

// Program.cs
builder.Services.AddScopedAndMap<IUserService, UserService>();
// or AddTransientAndMap / AddSingletonAndMap

var app = builder.Build();
app.AddRegisteredEndpoints();   // maps all pending endpoints
app.Run();

Alternatively, register the service yourself and map endpoints separately:

builder.Services.AddScoped<IUserService, UserService>();
app.AddEndpoints<IUserService>();

Configuration

builder.Services.AddScopedAndMap<IUserService, UserService>(options =>
{
    options.BasePath = "/api/v1";
    options.UseInterfaceNameForPath = true;   // IUserService → /UserService/...
    options.RequiresAuthorization = true;
});

HTTP method inference

Method name starts with HTTP method
Get, Find, Fetch, List, Search GET
Create, Add, Insert, Post POST
Update, Edit, Modify, Put PUT
Delete, Remove DELETE
Patch PATCH
anything else POST

Override with [HttpGet], [HttpPost], or [HttpMethodType("PUT")] on the method.


Which package do I need?

Your project Package
Defines the shared interface Viaduct.Core
ASP.NET Core server Viaduct.Server
Client / consumer app Viaduct.Client
Needs both (integration tests, monolith) Viaduct

Requirements

  • .NET 8, 9, or 10
  • C# 14+ (uses [InterceptsLocation] for compile-time interception)
  • ASP.NET Core

Full documentation and examples →

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on Viaduct.Server:

Package Downloads
Viaduct

Meta-package that includes both Viaduct.Server and Viaduct.Client. Reference this package when your project needs both server-side endpoint mapping and client-side HTTP proxy generation (e.g. integration tests, monoliths). For most projects, reference Viaduct.Server or Viaduct.Client directly instead.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 120 5/2/2026
0.0.1 117 5/1/2026