ProtoTest.Hosting
1.1.9
dotnet add package ProtoTest.Hosting --version 1.1.9
NuGet\Install-Package ProtoTest.Hosting -Version 1.1.9
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="ProtoTest.Hosting" Version="1.1.9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ProtoTest.Hosting" Version="1.1.9" />
<PackageReference Include="ProtoTest.Hosting" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ProtoTest.Hosting --version 1.1.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ProtoTest.Hosting, 1.1.9"
#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.
#:package ProtoTest.Hosting@1.1.9
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ProtoTest.Hosting&version=1.1.9
#tool nuget:?package=ProtoTest.Hosting&version=1.1.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ProtoTest.Hosting
Runs a background worker or generic host in-process with the suite: it starts with the run, reads the run's settings and stops with the run.
dotnet add package ProtoTest.Hosting
Includes
- Registration through
AddWorkerHost<TProgram>(); the suite runs the worker's own entry point. - Nested workers:
AddApplication(...).AddWorkerHost<TProgram>("Billing")follows the application's provider chain:UseEnvironment()leaves the worker to the environment that runs the application, whileUseHost()hosts it in this process and bridges the test clock. - Run-scoped lifetime: started after the infrastructure registered before it, stopped with the run.
- The suite's configuration, the run's settings (container connection strings and settings
infrastructure values) and
AddWorkerHostoptions reach the worker's normal configuration, in that order of precedence, and are passed to the worker'sMainas command-line arguments, soHost.CreateApplicationBuilder(args)reads final-precedence values beforeBuild(). - Access from a test through
Proto.Context.Host<TProgram>()andHostService<TProgram, TService>().
Limits
- In-process only: a suite running against a published environment has no worker to start. Skip those
tests with
[RequiresCapability(ProtoCapabilityKinds.Worker)]- or nest the worker under its application, whereUseEnvironment()decides from the application's winner and starts nothing. - One worker instance per run; the run's state is shared between tests.
- Only a hosted worker (
UseHost()) declares theclockcapability and resolvesProto.Context.Host<TProgram>(); a worker the environment runs declaresworkeronly. - The worker's
Run()never runs; the suite starts and stops its host. - A parameterless
Main, or one that builds its host without passingargs, reads the overlay only when the host is built; options factories and hosted services still see it. - Start does not wait for readiness; register a readiness probe before the worker when it depends on a container that is still booting.
Learn more
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.Hosting (>= 10.0.12)
- ProtoTest.Core (>= 1.1.9)
-
net8.0
- Microsoft.Extensions.Hosting (>= 8.0.1)
- ProtoTest.Core (>= 1.1.9)
-
net9.0
- Microsoft.Extensions.Hosting (>= 9.0.20)
- ProtoTest.Core (>= 1.1.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.