Dosaic.Hosting.WebHost 1.0.30

dotnet add package Dosaic.Hosting.WebHost --version 1.0.30                
NuGet\Install-Package Dosaic.Hosting.WebHost -Version 1.0.30                
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="Dosaic.Hosting.WebHost" Version="1.0.30" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dosaic.Hosting.WebHost --version 1.0.30                
#r "nuget: Dosaic.Hosting.WebHost, 1.0.30"                
#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.
// Install Dosaic.Hosting.WebHost as a Cake Addin
#addin nuget:?package=Dosaic.Hosting.WebHost&version=1.0.30

// Install Dosaic.Hosting.WebHost as a Cake Tool
#tool nuget:?package=Dosaic.Hosting.WebHost&version=1.0.30                

Dosaic.Hosting.Webhost

Nuget Nuget

Dosaic.Hosting.WebHost is the core package that allows dotnet dev's to use the dosaic web host and dosaic plugins.

This package is mandatory, without it you can't use any plugins

Installation

To install the nuget package follow these steps:


dotnet add package Dosaic.Hosting.Generator # this is required so the web host can discover & load the plugins
dotnet add package Dosaic.Hosting.WebHost

or add as package reference to your .csproj

<PackageReference Include="Dosaic.Hosting.Generator" Version="" />
<PackageReference Include="Dosaic.Hosting.WebHost" Version="" />

Rewrite the Entrypoint Program.cs to have following code:

using Dosaic.Hosting.WebHost;
PluginWebHostBuilder.RunDefault(Dosaic.Generated.DosaicPluginTypes.All);

Config files and ENV vars

Dosaic will try to load config files and values in the following order

  1. appsettings.json
  2. appsettings.yaml
  3. appsettings.yml
  4. appsettings.*.json
  5. appsettings.*.yaml
  6. appsettings.*.yml
  7. appsettings.secrets.yml
  8. appsettings.*.secrets.yml 9ENV variables

NOTE: All settings (does not matter which file extension) will be ordered by node length. And the secret files will be loaded as last (except the environment variables).

Example:

  1. appsettings.yaml
  2. appsettings.api.yaml
  3. appsettings.api.host.yaml
  4. appsettings.secrets.yaml
  5. apssettings.api.secrets.yaml
  6. appsettings.api.host.secrets.yaml
  7. ENV Variables

File names must always start with appsettings or they will be ignored!

Nested settings use _ to build their hierarchy as ENV variables

host:
  urls: http://+:5300 # optional, default is 8080;separate multiple urls with ","

becomes

HOST_URLS=http://+:5300 # optional, default is 8080;separate multiple urls with ","

General settings

Configure your config file with these properties

host:
  urls: http://+:5300 # optional, default is 8080;separate multiple urls with ","
  maxRequestSize: 8388608 # optional, default is 8 MB

or as ENV variables

HOST_URLS=http://+:5300 # optional, default is 8080;separate multiple urls with ","
HOST_MAXREQUESTSIZE=8388608 # optional, default is 8 MB

Logging

Configure your appsettings.logging.yml with these properties

serilog:
  minimumLevel: Debug # or Warn or Info
  override:
    System: Error # or Warning or Information
    Microsoft: Error # or Warning or Information

or as ENV variables

SERIOLOG_minimumLevel=Debug
SERIOLOG_OVERRIDE_SYSTEM=Error
SERIOLOG_OVERRIDE_MICROSOFT=Error

Usage

Rewrite your entrypoint Program.cs to have following code:

Dosaic.Hosting.WebHostPluginWebHostBuilder.RunDefault(Dosaic.Generated.DosaicPluginTypes.All);

Now you can add additional plugins as nuget packages to your project and configure them via config files/settings and/or in your web host plugin

OpenTelemetry settings

Dosaic uses open telemetry for it's tracing capabilities. Further info can be found here

https://opentelemetry.io/docs/instrumentation/net/getting-started/

If there is a tracing host configured, the service will try to send any traces, metrics or logs to this host. it will also enrich the log messages with SpanIds and TraceIds.

telemetry:
  host: http://localhost:3333
  protocol: grpc
  headers:
    - name: Authorization
      value: Bearer

Metrics

Dosaic uses open telemetry for it's metrics capabilities. Further info can be found here

#metrics

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. 
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.30 34 1/30/2025
1.0.27 8 1/29/2025
1.0.26 3 1/29/2025
1.0.25 3 1/29/2025
1.0.18 30 1/23/2025
1.0.17 25 1/23/2025