Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithBuildEnvironment

Method
📦 Aspire.Hosting.Dotnet v17.0.0
func (DotnetProjectResource) 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().

Applies to

This method applies to the following types: