Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithArgsCallback

Method
📦 Aspire.Hosting v17.0.0
func (ResourceWithArgs) WithArgsCallback(callback func(obj CommandLineArgsCallbackContext)) ResourceWithArgs

Signature

methodWithArgsCallbackbuilder
Adds a callback to be executed with a list of command-line arguments when a resource is started.
WithArgsCallback(callback func(obj CommandLineArgsCallbackContext)) ResourceWithArgs
callbackfunc(obj CommandLineArgsCallbackContext)callbackA callback that allows for deferred execution for computing arguments. This runs after resources have been allocated by the orchestrator and allows access to other resources to resolve computed data, e.g. connection strings, ports.
ResourceWithArgs

The resource builder.

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

Applies to

This method applies to the following types: