Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

DotnetProjectResource.WithBuildEnvironment

Method
📦 Aspire.Hosting.Dotnet v17.0.0
type DotnetProjectResource interface {
// ... 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

A reference to the IResourceBuilder for chaining additional configuration.

Returns a handle; failures surface later via Err().

Defined on

This method is defined on the following type: