PiBox.Hosting.Generator 1.0.79

dotnet add package PiBox.Hosting.Generator --version 1.0.79                
NuGet\Install-Package PiBox.Hosting.Generator -Version 1.0.79                
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.79" />                
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.79                
#r "nuget: PiBox.Hosting.Generator, 1.0.79"                
#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.79

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

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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.0

    • 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.79 39 12/20/2024
1.0.73 79 10/22/2024
1.0.66 184 10/15/2024
1.0.64 102 10/14/2024
1.0.61 114 10/1/2024
1.0.60 114 9/27/2024
1.0.54 299 4/30/2024
1.0.51 145 2/27/2024
1.0.49 105 2/27/2024
1.0.47 134 2/21/2024
1.0.45 131 2/20/2024
1.0.43 109 2/13/2024
1.0.41 128 2/13/2024
1.0.39 118 2/8/2024
1.0.38 108 2/8/2024
1.0.37 129 2/8/2024
1.0.35 94 2/2/2024
1.0.32 120 1/30/2024
1.0.25 161 12/27/2023
1.0.23 149 12/19/2023
1.0.22 108 12/19/2023
1.0.21 115 12/19/2023
1.0.19 135 12/11/2023
1.0.17 185 11/23/2023
1.0.7 128 11/23/2023
1.0.5 132 11/23/2023
1.0.3 127 11/23/2023
1.0.0 141 11/21/2023
0.9.9 141 11/21/2023
0.9.7 139 11/21/2023
0.9.6 142 11/21/2023