Asgard.Yggdrasil.AspNetCore 4.0.0-preview.7

This is a prerelease version of Asgard.Yggdrasil.AspNetCore.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Asgard.Yggdrasil.AspNetCore --version 4.0.0-preview.7
                    
NuGet\Install-Package Asgard.Yggdrasil.AspNetCore -Version 4.0.0-preview.7
                    
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="Asgard.Yggdrasil.AspNetCore" Version="4.0.0-preview.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Asgard.Yggdrasil.AspNetCore" Version="4.0.0-preview.7" />
                    
Directory.Packages.props
<PackageReference Include="Asgard.Yggdrasil.AspNetCore" />
                    
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 Asgard.Yggdrasil.AspNetCore --version 4.0.0-preview.7
                    
#r "nuget: Asgard.Yggdrasil.AspNetCore, 4.0.0-preview.7"
                    
#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 Asgard.Yggdrasil.AspNetCore@4.0.0-preview.7
                    
#: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=Asgard.Yggdrasil.AspNetCore&version=4.0.0-preview.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Asgard.Yggdrasil.AspNetCore&version=4.0.0-preview.7&prerelease
                    
Install as a Cake Tool

Asgard.Yggdrasil.AspNetCore

Asgard.Yggdrasil.AspNetCore is the ASP.NET Core host package for Asgard.

For application teams, this is the package to install when they want to:

  • build their own web host
  • keep control over Program.cs
  • use Asgard infrastructure and lifecycle hooks
  • treat their own business module as a built-in plugin

Runtime directory scanning is still supported, but it is now an optional extension path for drop-in plugins, hot-plug scenarios, and deployment-time customization. It is not the primary integration model for normal application teams.

Install

dotnet add package Asgard.Yggdrasil.AspNetCore

The recommended integration model is:

  1. Create your own ASP.NET Core app.
  2. Reference Asgard.Yggdrasil.AspNetCore.
  3. Start the host with YggdrasilHost.
  4. Put your business module into one or more built-in plugins.

That keeps the application in control while still letting Asgard manage service registration, plugin lifecycle, middleware composition, and infrastructure capabilities.

Quick Start

Program.cs

using Asgard.Yggdrasil.AspNetCore;
using Asgard.Abstractions.AspNetCore.Extensions;
using Microsoft.AspNetCore.Builder;

var builder = YggdrasilHost.CreateBuilder("config/app.yaml")
    .UseBuiltInPlugin<MyBusinessPlugin>()
    .ConfigureMiddleware(app =>
    {
        app.UseAsgardExceptionHandler()
           .UseHttpsRedirection();
    })
    .AfterHostBuild(_ =>
    {
        Console.WriteLine("[OK] Asgard Yggdrasil host started");
    });

var app = builder.Build();
await app.RunAsync();

If YggdrasilHost is not visible in your project, first make sure both of these are true:

  1. The project references Asgard.Yggdrasil.AspNetCore
  2. Program.cs includes using Asgard.Yggdrasil.AspNetCore;

Minimal package install command:

dotnet add package Asgard.Yggdrasil.AspNetCore

Built-in Plugin

using Asgard.Core.Plugin;
using Asgard.Abstractions.Plugin;

public sealed class MyBusinessPlugin : PluginBase
{
    public override string Id => "member-center";

    public override string Name => "Member Center";

    public override Version Version => new(1, 0, 0);

    protected override Task OnConfigureServicesAsync(
        IPluginServiceConfigurationContext context,
        CancellationToken cancellationToken)
    {
        context.Services.AddScoped<IMemberService, MemberService>();
        return Task.CompletedTask;
    }

    protected override Task OnConfigureMiddlewareAsync(
        IPluginMiddlewareConfigurationContext context,
        CancellationToken cancellationToken)
    {
        context.App.MapControllers();
        return Task.CompletedTask;
    }
}

Built-in Plugin APIs

Use one of these host builder APIs depending on how explicit you want startup to be:

  • UseBuiltInPlugin<TPlugin>()
  • UseBuiltInPluginsFromAssembly(Assembly assembly)
  • UseEntryAssemblyPlugins()

UseBuiltInPlugin<TPlugin>() is the most explicit and recommended option for normal applications.

Configuration

The current host API still expects a configuration file path, typically:

config/app.yaml

A minimal setup usually includes:

host:
  application:
    name: "MyApp"
    version: "1.0.0"
    environment: "Development"
  kestrel:
    endpoints:
      http:
        url: "http://127.0.0.1:5000"
  staticFiles:
    enabled: true
    webRootPath: "wwwroot"
    requestPath: ""
  auth:
    enabled: false
    jwt:
      secretKey: "12345678901234567890123456789012"
      issuer: "Asgard"
      audience: "Asgard.Users"
  healthCheck:
    enabled: true
  rateLimiting:
    enabled: false

Asgard:
  Encryption:
    Key: "your-base64-key"
    Iv: "your-base64-iv"

logging:
  minimumLevel: Debug
  console:
    enabled: true
  file:
    enabled: false

caching:
  enabled: false

database:
  enabled: false

messaging:
  enabled: false

job:
  enabled: false
  jobs: []

plugin:
  enabled: false

Only the host.* tree is used for host-level settings. Do not place host settings under top-level Application or Kestrel nodes, because the current host builder does not read those paths.

When you register built-in plugins in code, the host will enable the plugin system automatically for that application instance.

Static Files

Static files are configured through host.staticFiles.

host:
  staticFiles:
    enabled: true
    webRootPath: "wwwroot"
    requestPath: "/assets"

Behavior:

  • enabled: true enables static file hosting
  • webRootPath can be relative or absolute
  • relative paths are resolved from the application content root
  • requestPath: "" serves files from the site root
  • requestPath: "/assets" serves files from /assets/*

When you configure middleware manually, keep custom middleware focused on business concerns. Static files, CORS, authentication, authorization, rate limiting, and health endpoints are managed by the host from host.*.

Optional Runtime Plugin Discovery

Filesystem-based plugin discovery is still available when you need external plugins:

plugin:
  enabled: true
  scanDirectories:
    - path: "plugins"
      enabled: true
      recursive: false
      entryPointPattern: "*.Plugin.dll"

Use this mode for:

  • deployment-time drop-in extensions
  • hot-plug operational scenarios
  • private plugin marketplaces
  • tenant- or environment-specific external modules

Do not use it as the default integration path for an application that already references your packages directly.

Package Guidance

  • Application host: install Asgard.Yggdrasil.AspNetCore
  • Reusable runtime plugin implementation: depend on Asgard.Core
  • Contracts-only integration: depend on Asgard.Abstractions or Asgard.Abstractions.AspNetCore
  • Asgard.Yggdrasil.AspNetCore
  • Asgard.AspNetCore.Core
  • Asgard.Core
  • Asgard.Abstractions
  • Asgard.Abstractions.AspNetCore
Product Compatible and additional computed target framework versions.
.NET 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 Asgard.Yggdrasil.AspNetCore:

Package Downloads
Asgard.PluginSdk

Common plugin development dependencies and convenience APIs for Asgard plugins.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.1.3 36 4/28/2026
4.1.2 94 4/21/2026
4.1.1 99 4/15/2026
4.1.0 97 4/14/2026
4.0.5 96 4/11/2026
4.0.4 100 4/10/2026
4.0.3 95 4/9/2026
4.0.2 99 4/8/2026
4.0.1 109 4/3/2026
4.0.0 111 4/1/2026
4.0.0-preview.7 57 3/31/2026
4.0.0-preview.6 53 3/30/2026
4.0.0-preview.5 144 3/28/2026
4.0.0-preview.4 53 3/27/2026