PiBox.Hosting.Generator 1.0.22

There is a newer version of this package available.
See the version list below for details.
dotnet add package PiBox.Hosting.Generator --version 1.0.22
NuGet\Install-Package PiBox.Hosting.Generator -Version 1.0.22
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="PiBox.Hosting.Generator" Version="1.0.22" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PiBox.Hosting.Generator --version 1.0.22
#r "nuget: PiBox.Hosting.Generator, 1.0.22"
#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 PiBox.Hosting.Generator as a Cake Addin
#addin nuget:?package=PiBox.Hosting.Generator&version=1.0.22

// Install PiBox.Hosting.Generator as a Cake Tool
#tool nuget:?package=PiBox.Hosting.Generator&version=1.0.22

PiBox.Hosting.Generator

PiBox framework

PiBox.Hosting.Generator is a dotnet source generator package that allows dotnet dev's to use the pibox web host to discover available pibox plugins.

Installation

To install the nuget package follow these steps:


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

or add as package reference to your .csproj

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

Concept

The source generator will scan all assemblies which are referenced by the PiBox.Hosting.Webhost project and add any classes or interfaces which are implementing

  • the interface IPluginActivateable
  • any class attribute which starts with the name PiBox

to generate a class like the following example

using System;
using System.Diagnostics.CodeAnalysis;
using System.CodeDom.Compiler;
namespace PiBox.Generated;

[ExcludeFromCodeCoverage]
[GeneratedCode("PiBox.Hosting.Generator", "0.5.0.0")]
public class PiBoxPluginTypes {
 public static Type[] All = new Type[] {
  typeof(PiBox.Hosting.WebHost.Sample.HangfireTestJob),
  typeof(PiBox.Hosting.WebHost.Sample.WebHostSamplePlugin),
  typeof(PiBox.Hosting.WebHost.Sample.NpgsqlDbConfiguration),
  typeof(PiBox.Api.OpenApi.OpenApiConfiguration),
  typeof(PiBox.Api.OpenApi.OpenApiPlugin),
  typeof(PiBox.Plugins.Authorization.Keycloak.KeycloakPlugin),
  typeof(PiBox.Plugins.Authorization.Keycloak.KeycloakPluginConfiguration),
  typeof(PiBox.Plugins.Endpoints.RestResourceEntity.RestResourceEntityPlugin),
  typeof(PiBox.Plugins.Jobs.Hangfire.HangfireConfiguration),
  typeof(PiBox.Plugins.Jobs.Hangfire.HangFirePlugin),
  typeof(PiBox.Plugins.Persistence.EntityFramework.EntityFrameworkPlugin),
  typeof(PiBox.Hosting.Abstractions.Middlewares.ExceptionMiddleware),
  typeof(PiBox.Hosting.Abstractions.Middlewares.RequestContentLengthLimitMiddleware),
  typeof(PiBox.Plugins.Handlers.Cqrs.SimpleResource.CqrsSimpleResourcePlugin),
 };
}

This class then gets referenced by the webhost's Program.cs e.g.

If you don't include the generator package, you must specify the allowed plugin types manually!

using PiBox.Hosting.WebHost;
PluginWebHostBuilder.RunDefault(PiBox.Generated.PiBoxPluginTypes.All);

The webhost's service-, host- and application-configurators then access this list of types to activate and load all the found plugins on startup.

Excludes

The following namespaces will be ignored when the source generator goes through all the assemblies at build time:

  • Microsoft
  • System
  • FastEndpoints
  • testhost
  • netstandard
  • Newtonsoft
  • mscorlib
  • NuGet
  • NSwag
  • FluentValidation
  • YamlDotNet
  • Accessibility
  • NJsonSchema
  • Namotion"

Changes to this list may happen in the future based on new requirements.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

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.54 179 4/30/2024
1.0.51 104 2/27/2024
1.0.49 79 2/27/2024
1.0.47 92 2/21/2024
1.0.45 102 2/20/2024
1.0.43 66 2/13/2024
1.0.41 77 2/13/2024
1.0.39 73 2/8/2024
1.0.38 77 2/8/2024
1.0.37 81 2/8/2024
1.0.35 76 2/2/2024
1.0.32 75 1/30/2024
1.0.25 143 12/27/2023
1.0.23 118 12/19/2023
1.0.22 95 12/19/2023
1.0.21 90 12/19/2023
1.0.19 109 12/11/2023
1.0.17 154 11/23/2023
1.0.7 102 11/23/2023
1.0.5 106 11/23/2023
1.0.3 113 11/23/2023
1.0.0 95 11/21/2023
0.9.9 110 11/21/2023
0.9.7 99 11/21/2023
0.9.6 111 11/21/2023