WorldDomination.SimpleHosting 3.0.0-pre.1

This is a prerelease version of WorldDomination.SimpleHosting.
dotnet add package WorldDomination.SimpleHosting --version 3.0.0-pre.1
NuGet\Install-Package WorldDomination.SimpleHosting -Version 3.0.0-pre.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="WorldDomination.SimpleHosting" Version="3.0.0-pre.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WorldDomination.SimpleHosting --version 3.0.0-pre.1
#r "nuget: WorldDomination.SimpleHosting, 3.0.0-pre.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.
// Install WorldDomination.SimpleHosting as a Cake Addin
#addin nuget:?package=WorldDomination.SimpleHosting&version=3.0.0-pre.1&prerelease

// Install WorldDomination.SimpleHosting as a Cake Tool
#tool nuget:?package=WorldDomination.SimpleHosting&version=3.0.0-pre.1&prerelease

<h1 align="center">Simple: Hosting</h1>

<div align="center"> Making it simple to <i>customize</i> Hosting for your ASP.NET Core 6.x+ application </div>

<br />

<div align="center">

<a href="https://choosealicense.com/licenses/mit/">
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" alt="License - MIT" />
</a>

<a href="https://www.nuget.org/packages/WorldDomination.SimpleHosting/">
<img src="https://buildstats.info/nuget/WorldDomination.SimpleHosting" alt="NuGet" />
</a>

<a href="https://ci.appveyor.com/api/projects/status/SimpleHosting/branch/master?svg=true">
<img src="https://ci.appveyor.com/api/projects/status/011jx778q0h7g2vs?svg=true" alt="AppVeyor-CI" />
</a>

</div>

Key Points

  • 🚀 Reduces boilerplate ceremony for your program.cs file.
  • ✅ Sets up Serilog around the entire application. (:wrench: Configure all settings via your appsettings.json file(s))
  • ✅ Simple to add some extra (helpful) log header/footer.
  • ✅ Can also add logging to your Startup class (new with ASP.NET Core 6+)

In summary: this library makes is <b>SIMPLE</b> (by abstracting away most of the boring ceremony) to setup your ASP.NET Core application.


Installation

Package is available via NuGet.

dotnet add package WorldDomination.SimpleHosting 

More Information:

Basically, turn your program.cs into this :

public static Task Main(string[] args)
{
    return WorldDomination.SimpleHosting.Program.Main<Startup>(args);
}

and you've now got some Serilog all wired up along with some nice application-wide error handling.

For more custom settings:

public static Task Main(string[] args)
{
    // Every Option here is optional.
    // Set what you want.
    var options = new MainOptions
    {
        CommandLineArguments = args,
        FirstLoggingInformationMessage = "~~ Sample Web Application ~~",
        LogAssemblyInformation = true,
        LastLoggingInformationMessage = "-- Sample Web Application has ended/terminated --",
        StartupActivation = new System.Func<WebHostBuilderContext, ILogger, Startup>((context, logger) => new Startup(context.Configuration, logger))
    };

    return SimpleHosting.Program.Main<Startup>(options);
}

Contribute

Yep - contributions are always welcome. Please read the contribution guidelines first.

Code of Conduct

If you wish to participate in this repository then you need to abide by the code of conduct.

Feedback

Yes! Please use the Issues section to provide feedback - either good or needs improvement 🆒


Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
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
3.0.0-pre.1 1,711 11/10/2021
2.0.0-pre.3 246 1/10/2021
2.0.0-pre.2 190 1/7/2021
2.0.0-pre.1 218 11/21/2020
1.0.0 484 11/2/2020