Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

DotnetProjectResource

Handle
📦 Aspire.Hosting.Dotnet v17.0.0

A resource that represents an SDK-style .NET project or file-based C# app added by path.

type DotnetProjectResource interface {
DotnetProgramResource
IComputeResource
IContainerFilesDestinationResource
Resource
ResourceWithArgs
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

Methods

Disables automatic forwarded-header configuration when publishing the .NET project.
DisableForwardedHeaders() DotnetProjectResource
DotnetProjectResource

The same builder for chaining additional configuration.

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

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().

Configures endpoint environment-variable injection for a .NET project in polyglot AppHosts.
WithEndpointsInEnvironment(endpointNames []string) DotnetProjectResource
endpointNames[]string
DotnetProjectResource

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

methodWithReplicasbuilder
Configures the number of replicas of the .NET project.
WithReplicas(replicas float64) DotnetProjectResource
replicasfloat64The number of replicas.
DotnetProjectResource

The same builder for chaining additional configuration.

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