PiBox.Hosting.Generator 1.0.66

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

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

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.73 70 10/22/2024
1.0.66 139 10/15/2024
1.0.64 97 10/14/2024
1.0.61 109 10/1/2024
1.0.60 109 9/27/2024
1.0.54 290 4/30/2024
1.0.51 140 2/27/2024
1.0.49 102 2/27/2024
1.0.47 131 2/21/2024
1.0.45 128 2/20/2024
1.0.43 106 2/13/2024
1.0.41 121 2/13/2024
1.0.39 111 2/8/2024
1.0.38 101 2/8/2024
1.0.37 120 2/8/2024
1.0.35 89 2/2/2024
1.0.32 117 1/30/2024
1.0.25 158 12/27/2023
1.0.23 144 12/19/2023
1.0.22 105 12/19/2023
1.0.21 112 12/19/2023
1.0.19 132 12/11/2023
1.0.17 180 11/23/2023
1.0.7 125 11/23/2023
1.0.5 127 11/23/2023
1.0.3 122 11/23/2023
1.0.0 136 11/21/2023
0.9.9 138 11/21/2023
0.9.7 136 11/21/2023
0.9.6 139 11/21/2023