Watch Aspire live streamsDocsTry Aspire

withBuildEnvironment

Method
📦 Aspire.Hosting.Dotnet v17.0.0
interface DotnetProjectResource {
// ... omitted for brevity
withBuildEnvironment(
name: string,
value: string): DotnetProjectResource;
}

Signature

methodwithBuildEnvironmentbuilder
Adds an environment variable to the build process for a .NET project.
withBuildEnvironment(
name: string,
value: string): DotnetProjectResource
namestringThe name of the environment variable.
valuestringThe value of the environment variable.
DotnetProjectResource

Applies to

This method applies to the following types: