CP.Extensions.Hosting.MainUIThread
1.3.2
See the version list below for details.
dotnet add package CP.Extensions.Hosting.MainUIThread --version 1.3.2
NuGet\Install-Package CP.Extensions.Hosting.MainUIThread -Version 1.3.2
<PackageReference Include="CP.Extensions.Hosting.MainUIThread" Version="1.3.2" />
<PackageVersion Include="CP.Extensions.Hosting.MainUIThread" Version="1.3.2" />
<PackageReference Include="CP.Extensions.Hosting.MainUIThread" />
paket add CP.Extensions.Hosting.MainUIThread --version 1.3.2
#r "nuget: CP.Extensions.Hosting.MainUIThread, 1.3.2"
#:package CP.Extensions.Hosting.MainUIThread@1.3.2
#addin nuget:?package=CP.Extensions.Hosting.MainUIThread&version=1.3.2
#tool nuget:?package=CP.Extensions.Hosting.MainUIThread&version=1.3.2
CP.Extensions.Hosting
An Extension of the Microsoft.Extensions.Hosting library with the aim of allowing windows applications to use the hosting base.
CP.Extensions.Hosting.Identity.EntityFrameworkCore.Sqlite
.UseWebHostServices((whb, services) =>
{
services.UseEntityFrameworkCoreSqlite<DBContext, IdentityUser, IdentityRole>(whb, "DefaultConnection")
.Configure<IdentityOptions>(options =>
{
// Configure options
});
})
CP.Extensions.Hosting.Identity.EntityFrameworkCore.SqlServer
.UseWebHostServices((whb, services) =>
{
services.UseEntityFrameworkCoreSqlServer<DBContext, IdentityUser, IdentityRole>(whb, "DefaultConnection")
.Configure<IdentityOptions>(options =>
{
// Configure options
});
})
CP.Extensions.Hosting.MainUIThread
Used to run the main UI thread in a Wpf / WinUI / WinForms application.
CP.Extensions.Hosting.Plugins
.ConfigurePlugins(pluginBuilder =>
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Running using dotNet {0}", Environment.Version);
//// Specify the location from where the Dll's are "globbed"
var process = Process.GetCurrentProcess();
var fullPath = process.MainModule?.FileName?.Replace(process.MainModule.ModuleName!, string.Empty);
Console.WriteLine("Add Scan Directories: {0}", fullPath);
pluginBuilder?.AddScanDirectories(fullPath!);
//// Add the framework libraries which can be found with the specified globs
pluginBuilder?.IncludeFrameworks(@"\netstandard2.0\*.FrameworkLib.dll");
//// Add the plugins which can be found with the specified globs
var runtime = targetRuntime ?? Path.GetFileName(executableLocation);
Console.WriteLine(@"Include Plugins from: \Plugins\{0}\{1}*.dll", runtime, nameSpace);
pluginBuilder?.IncludePlugins(@$"\Plugins\{runtime}\{##YourPluginNameSpace##}*.dll");
Console.ResetColor();
})
/// <summary>
/// This plug-in configures the HostBuilderContext to have the hosted services from the online example
/// </summary>
public class Plugin : PluginBase<FirstService, SecondService, ThirdService>
{
}
CP.Extensions.Hosting.PluginService
await ServiceHost.Create(
typeof(Program),
args,
hb => hb, // Configure the HostBuilder
host => {}, // Configure the Host
nameSpace: "AICS.Plugin").ConfigureAwait(false);
CP.Extensions.Hosting.ReactiveUI.WinForms
.ConfigureSplatForMicrosoftDependencyResolver()
CP.Extensions.Hosting.ReactiveUI.WinUI
.ConfigureSplatForMicrosoftDependencyResolver()
CP.Extensions.Hosting.ReactiveUI.Wpf
.ConfigureSplatForMicrosoftDependencyResolver()
CP.Extensions.Hosting.SingleInstance
.ConfigureSingleInstance(builder =>
{
builder.MutexId = "{ea031523-3a63-45e5-85f2-6fa75fbf37ed}";
builder.WhenNotFirstInstance = (hostingEnvironment, logger) =>
{
// Application already started, this is another instance
logger.LogWarning("Application {0} already running.", hostingEnvironment.ApplicationName);
};
})
CP.Extensions.Hosting.WinForms
.ConfigureWinForms<MainForm>()
.UseWinFormsLifetime()
CP.Extensions.Hosting.WinUI
.ConfigureWinUI<MainWindow>()
.UseWpfLifetime()
CP.Extensions.Hosting.Wpf
.ConfigureWpf<MainWindow>()
.UseWpfLifetime()
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net7.0-windows7.0 is compatible. net8.0-windows was computed. net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Microsoft.Extensions.Hosting (>= 8.0.0)
-
net6.0-windows7.0
- Microsoft.Extensions.Hosting (>= 8.0.0)
-
net7.0-windows7.0
- Microsoft.Extensions.Hosting (>= 8.0.0)
-
net8.0-windows7.0
- Microsoft.Extensions.Hosting (>= 8.0.0)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on CP.Extensions.Hosting.MainUIThread:
| Package | Downloads |
|---|---|
|
CP.Extensions.Hosting.Wpf
This extension adds WPF support to generic host applications. With this you can enhance your application with a UI, and use all the services provided by the generic host like DI, logging etc. |
|
|
CrissCross.WPF.UI
A Reactive Navigation Framework for ReactiveUI |
|
|
CP.Extensions.Hosting.WinUI
This extension adds WinUI support to generic host applications. With this you can enhance your application with a UI, and use all the services provided by the generic host like DI, logging etc. |
|
|
CP.Extensions.Hosting.WinForms
This extension adds WinForms support to generic host based applications. With this you can enhance your application with a UI, and use all the services provided by the generic host like DI, logging etc. |
|
|
CrissCross.WPF.Plot
A Reactive Navigation Framework for ReactiveUI |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.6 | 113 | 3/12/2026 |
| 3.0.4 | 144 | 3/8/2026 |
| 3.0.0-beta.10 | 78 | 1/22/2026 |
| 2.3.15 | 992 | 12/2/2025 |
| 2.3.13 | 622 | 12/1/2025 |
| 2.3.4 | 231 | 11/3/2025 |
| 2.3.3 | 190 | 11/3/2025 |
| 2.2.2 | 487 | 9/10/2025 |
| 2.1.13 | 1,252 | 4/29/2025 |
| 2.1.10 | 270 | 3/16/2025 |
| 2.1.8 | 256 | 2/19/2025 |
| 2.1.6 | 208 | 2/9/2025 |
| 2.1.4 | 298 | 11/21/2024 |
| 2.0.5 | 490 | 5/18/2024 |
| 1.5.2 | 242 | 5/17/2024 |
| 1.4.2 | 252 | 5/5/2024 |
| 1.3.13 | 239 | 5/1/2024 |
| 1.3.2 | 310 | 4/11/2024 |
| 1.2.2 | 278 | 3/26/2024 |
| 1.1.90 | 272 | 3/19/2024 |
Compatability with Net 6 / 7 / 8 and net462