Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In Aspire 9.5, the InteractionInput API changes its contract: Name is now required and Label becomes optional. Automatic generation of Name from Label is removed, and a new EffectiveLabel member returns Label when specified, otherwise Name. This simplifies reasoning about inputs and avoids hidden inference.
Version introduced
Aspire 9.5
Previous behavior
Nameoptional; when omitted it was implicitly generated from the requiredLabel.Labelrequired.- No
EffectiveLabelconvenience member existed.
Example (worked previously without an explicit Name):
var inputs = new InteractionInputCollection
{
new InteractionInput(label: "Subscription ID", value: subscriptionId)
};
The runtime inferred a Name (for example a normalized token from "Subscription ID").
New behavior
Nameis required and must be supplied explicitly.Labelis optional (use it for a friendly display string distinct fromName).EffectiveLabelsurfacesLabelif present, else falls back toName.- No implicit generation of
Nameoccurs.
Updated example:
var inputs = new InteractionInputCollection
{
new InteractionInput(name: "SubscriptionId", label: "Subscription ID", value: subscriptionId),
new InteractionInput(name: "Region", value: region) // Label omitted; EffectiveLabel == "Region"
};
foreach (var input in inputs)
{
Console.WriteLine($"Display: {input.EffectiveLabel} (Name: {input.Name})");
}
Type of breaking change
This is a source compatibility and binary compatibility change.
Reason for change
The implicit derivation of Name from Label introduced ambiguity, made renames risky, and forced all callers to provide a Label even when a friendly display value was unnecessary. Making Name explicit improves clarity, stability of identifiers, and reduces accidental coupling between display text and programmatic keys. Adding EffectiveLabel preserves convenient display semantics without requiring callers to duplicate values.
Recommended action
- Add an explicit
name:argument to everyInteractionInputinstantiation that previously omitted it. - Remove any unneeded
label:arguments when the value would simply duplicatename:. - If your code depended on the inferred naming convention, replicate the previous transformation manually (for example, remove spaces or punctuation) when choosing the new explicit
Name. - Use
EffectiveLabelin UI / logging code that previously assumedLabelwas always present.
Migration example (before -> after):
- new InteractionInput(label: "Resource Group", value: rg)
+ new InteractionInput(name: "ResourceGroup", label: "Resource Group", value: rg)
- new InteractionInput(label: "Region", value: region)
+ new InteractionInput(name: "Region", value: region) // Label not needed
Affected APIs
- Aspire.Hosting.InteractionInput
InteractionInput.Name- Aspire.Hosting.InteractionInput.Label