PiBox.Hosting.Generator 1.0.7

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.7                
NuGet\Install-Package PiBox.Hosting.Generator -Version 1.0.7                
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.7" />                
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.7                
#r "nuget: PiBox.Hosting.Generator, 1.0.7"                
#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.7

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

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.73 65 10/22/2024
1.0.66 128 10/15/2024
1.0.64 92 10/14/2024
1.0.61 104 10/1/2024
1.0.60 106 9/27/2024
1.0.54 287 4/30/2024
1.0.51 137 2/27/2024
1.0.49 99 2/27/2024
1.0.47 128 2/21/2024
1.0.45 125 2/20/2024
1.0.43 103 2/13/2024
1.0.41 118 2/13/2024
1.0.39 106 2/8/2024
1.0.38 98 2/8/2024
1.0.37 117 2/8/2024
1.0.35 86 2/2/2024
1.0.32 114 1/30/2024
1.0.25 155 12/27/2023
1.0.23 141 12/19/2023
1.0.22 102 12/19/2023
1.0.21 109 12/19/2023
1.0.19 129 12/11/2023
1.0.17 177 11/23/2023
1.0.7 122 11/23/2023
1.0.5 124 11/23/2023
1.0.3 119 11/23/2023
1.0.0 133 11/21/2023
0.9.9 135 11/21/2023
0.9.7 133 11/21/2023
0.9.6 136 11/21/2023