Viaduct 0.1.1

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

Viaduct

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 is a convenience meta-package that includes both Viaduct.Server and Viaduct.Client. Use it when a single project needs both sides — for example, integration test projects or monolith applications that act as both server and consumer.

For most projects, reference Viaduct.Server or Viaduct.Client directly to keep dependencies minimal.


The single-source-of-truth model

┌─────────────────────────────────────────┐
│  Shared project (IUserService)          │
│  Define once. Change once. Done.        │
└────────────┬────────────────────────────┘
             │ same interface
     ┌───────┴───────┐
     ▼               ▼
  Server side      Client side
  maps endpoints   generates proxy
     └───────┬───────┘
             │
  ┌──────────┴──────────┐
  │  This project        │  ← references Viaduct (this package)
  │  (e.g. test project) │
  └─────────────────────┘

Quick start

// Integration test / monolith Program.cs
builder.Services.AddScopedAndMap<IUserService, UserService>();  // server side

builder.Services.CreateAndAddHttpClient<IUserService>(options =>
{
    options.BaseUrl = "https://localhost:5001";
});                                                              // client side

var app = builder.Build();
app.AddRegisteredEndpoints();

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

What's included

Referencing this package is equivalent to:

<PackageReference Include="Viaduct.Server" Version="..." />
<PackageReference Include="Viaduct.Client" Version="..." />

The Viaduct.Generator source generator is a shared transitive dependency — it runs exactly once even when both are referenced.


Requirements

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

Full documentation and examples →

There are no supported framework assets in this 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
0.1.1 127 5/2/2026
0.0.1 127 5/1/2026