WorldDomination.SimpleHosting 3.0.0-pre.1

.NET 6.0
This is a prerelease version of WorldDomination.SimpleHosting.
Install-Package WorldDomination.SimpleHosting -Version 3.0.0-pre.1
dotnet add package WorldDomination.SimpleHosting --version 3.0.0-pre.1
<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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WorldDomination.SimpleHosting, 3.0.0-pre.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

<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 Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
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 709 11/10/2021
2.0.0-pre.3 195 1/10/2021
2.0.0-pre.2 136 1/7/2021
2.0.0-pre.1 164 11/21/2020
1.0.0 292 11/2/2020