ProtoTest.Aspire
1.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ProtoTest.Aspire --version 1.1.0
NuGet\Install-Package ProtoTest.Aspire -Version 1.1.0
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.Aspire" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ProtoTest.Aspire" Version="1.1.0" />
<PackageReference Include="ProtoTest.Aspire" />
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.Aspire --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ProtoTest.Aspire, 1.1.0"
#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.Aspire@1.1.0
#: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.Aspire&version=1.1.0
#tool nuget:?package=ProtoTest.Aspire&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ProtoTest.Aspire
Preview: the surface can change before 1.2.
Runs an Aspire AppHost with the suite: it starts with the run, each declared resource becomes an application target, and the run releases it.
dotnet add package ProtoTest.Aspire
The package targets net8.0, net9.0 and net10.0; the suite's AppHost leg runs on net10.0.
Includes
- Registration through
AddAspireAppHost<TEntryPoint>(); the suite runs the AppHost's own entry point through the Aspire testing host. The AppHost serves only when selected: the globalProtoTest:Aspire:Enabledor a resource's ownProtoTest:Aspire:Resources:{resource}:Enabled. - Run-scoped lifetime: started after the infrastructure registered before it, stopped with the run.
- Each selected resource's endpoint published as
ProtoTest:Applications:{resource}:BaseUrl, so the application's clients andAddHttpReadinessresolve that one address. - Chain providers:
UseAspireResource<TEntryPoint>("resource")on an application publishes the resource's endpoint under its derivedBaseUrl, and on an infrastructure target publishes the resource's connection string under every declared key. The provider serves under the same selection keys; a configured provider earlier in the chain wins. The resource's key selects only its targets, so "AppHost infrastructure with an in-process application" and its reverse are expressible. - The run's configuration and the settings earlier infrastructure published travel to the AppHost as
command-line arguments (the options'
Setvalues last), so the AppHost's own graph reads the addresses the suite resolved. ProtoAspireOptions.MapConnectionString(resource, key)fills a key no target declares.- A run that configures every declared resource's key skips the AppHost even when selected and points at that environment instead; with only some configured, it starts and publishes only the selected missing keys, so a configured address is never masked.
- Per-test address lookup through
Proto.Context.AspireResource("api"). - The
aspirecapability and a run entity per AppHost, with the published endpoints as evidence.
Limits
net8.0/net9.0/net10.0package assets; the suite's AppHost leg isnet10.0, because DCP launchesAddProjectresources withdotnet runand cannot choose a target framework for a multi-targeted project.- Closed box: no per-test service substitution, no in-process assertions. White-box
worker tests use
ProtoTest.Hosting; topology runs use this package. - One AppHost instance per run; the run's state is shared between tests.
- Without either selection key the AppHost never starts and resolution falls through to the chain's other providers.
- The AppHost receives the run's configuration and settings as arguments; bridging them into its
projects (
AddConnectionString,WithEnvironment) stays the AppHost project's code, because only it knows its graph. - A connection-string resource has no endpoint:
ProtoAspireOptions.MapConnectionStringreplaces its endpoint publish, and a resource that exposes neither fails the AppHost start naming it. - The AppHost needs Aspire's orchestration binaries (DCP, dashboard) at runtime; they restore with
the AppHost SDK from NuGet. A suite that must run without them catches
ProtoAspireUnavailableExceptionat startup and skips with its message. - Start does not wait for readiness; register
AddHttpReadinessafter the AppHost for the HTTP resources tests call.
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
- Aspire.Hosting.Testing (>= 13.5.4)
- ProtoTest.Core (>= 1.1.0)
-
net8.0
- Aspire.Hosting.Testing (>= 13.5.4)
- ProtoTest.Core (>= 1.1.0)
-
net9.0
- Aspire.Hosting.Testing (>= 13.5.4)
- ProtoTest.Core (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.