Viaduct.Core 0.1.1

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

Viaduct.Core

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.Core is the foundation package. It contains the attributes and shared types that belong on your interface definition project — the shared contract that both the server and the client depend on.

It has no dependency on ASP.NET Core or HttpClient, keeping your contract project lean.


The single-source-of-truth model

┌─────────────────────────────────────────┐
│  Shared project (references Viaduct.Core)│
│                                         │
│  [BasePath("/users")]                   │
│  public interface IUserService          │
│  {                                      │
│      Task<User> GetUserAsync(int id);   │
│      Task CreateUserAsync(string name); │
│  }                                      │
└────────────┬────────────────────────────┘
             │ same interface
     ┌───────┴───────┐
     ▼               ▼
  Server project   Client project
  Viaduct.Server   Viaduct.Client
  (maps endpoints) (generates proxy)

Define the interface once in a shared project. Viaduct.Server reads it and maps Minimal API endpoints. Viaduct.Client reads it and generates a typed HttpClient proxy. Both stay in sync automatically — change the interface and both sides are updated at the next compile.


What's included

  • Attributes: [BasePath], [CustomRoute], [HttpMethodType], [ViaductIgnore], [ViaductIgnoreForServer]
  • Options: ViaductOptions base record
  • Exceptions: ViaductException, MissingRouteParameterException

Example

using Viaduct;

[BasePath("/users")]
public interface IUserService
{
    Task<User> GetUserAsync(int id, CancellationToken ct = default);
    Task CreateUserAsync(string name, DateTime dateOfBirth);

    [ViaductIgnore]           // excluded from both server and client
    void InternalMethod();

    [ViaductIgnoreForServer]  // client proxy only, no server endpoint
    Task<User> LocalFallbackAsync(int id);
}

The server and client projects reference this interface and add Viaduct.Server / Viaduct.Client to do the actual wiring — no changes to the interface needed.


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

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 (2)

Showing the top 2 NuGet packages that depend on Viaduct.Core:

Package Downloads
Viaduct.Server

Server-side runtime for Viaduct. Automatically maps DI service interfaces to ASP.NET Core Minimal API endpoints via the Viaduct source generator. Install this package in your ASP.NET Core server project.

Viaduct.Client

Client-side runtime for Viaduct. Automatically generates typed HttpClient proxies from service interfaces via the Viaduct source generator. Install this package in your client or consumer project.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 148 5/2/2026
0.0.1 146 5/1/2026