Description
AspireCliInvocationMode accepts invalid values silently. A misspelled or unsupported value is ignored/falls back to Aspire CLI resolution without any warning or error.
This makes configuration mistakes difficult to spot. For example, DnxPinnedd or DefinitelyInvalid does not fail validation and does not emit a warning; the SDK simply resolves the normal Aspire CLI path instead of DNX.
This is separate from explicit AspireCliPath precedence. The behavior below was confirmed with AspireCliPath cleared both as an environment variable and as an MSBuild property.
Reproduction
In a generic AppHost project using Aspire.AppHost.Sdk/13.5.1, set or pass an invalid invocation mode:
$env:AspireCliPath = ''
$env:ASPIRE_CLI_PATH = ''
dotnet msbuild app/Sample.AppHost/Sample.AppHost.csproj `
/t:_ResolveAspireCliInvocation `
/v:diag `
/p:AspireUseCliBundle=true `
/p:AspireCliInvocationMode=DefinitelyInvalid `
/p:AspireCliPath= `
/nologo |
Select-String -Pattern 'AspireCliInvocationMode=|AspireCliPath=|Aspire CLI invocation selection:'
Observed result:
Task Parameter:AspireCliInvocationMode=DefinitelyInvalid
Aspire CLI invocation selection: Aspire (aspire: C:\Users\<user>\.aspire\bin\aspire.exe, dnx: C:\Program Files\dotnet\dnx.cmd)
Running the validation target also succeeds:
$env:AspireCliPath = ''
$env:ASPIRE_CLI_PATH = ''
dotnet msbuild app/Sample.AppHost/Sample.AppHost.csproj `
/t:_ValidateAspireCliDnxInvocationMode `
/v:normal `
/p:AspireUseCliBundle=true `
/p:AspireCliInvocationMode=DefinitelyInvalid `
/p:AspireCliPath= `
/nologo
Observed result:
Build succeeded.
0 Warning(s)
0 Error(s)
Diagnostic output confirms the invalid property value was present:
AspireCliInvocationMode = DefinitelyInvalid
Expected behavior
The SDK should warn or error when AspireCliInvocationMode is set to an unsupported value.
For example, if the supported values are Path, Dnx, and DnxPinned, then a value like DefinitelyInvalid should produce a diagnostic explaining the accepted values.
Actual behavior
Invalid values are accepted silently. They do not produce a warning, error, or validation diagnostic, and resolution falls back to Aspire CLI mode.
Environment
- OS: Windows
- .NET SDK: 10.0.303
- AppHost SDK:
Aspire.AppHost.Sdk/13.5.1
Description
AspireCliInvocationModeaccepts invalid values silently. A misspelled or unsupported value is ignored/falls back to Aspire CLI resolution without any warning or error.This makes configuration mistakes difficult to spot. For example,
DnxPinneddorDefinitelyInvaliddoes not fail validation and does not emit a warning; the SDK simply resolves the normal Aspire CLI path instead of DNX.This is separate from explicit
AspireCliPathprecedence. The behavior below was confirmed withAspireCliPathcleared both as an environment variable and as an MSBuild property.Reproduction
In a generic AppHost project using
Aspire.AppHost.Sdk/13.5.1, set or pass an invalid invocation mode:Observed result:
Running the validation target also succeeds:
Observed result:
Diagnostic output confirms the invalid property value was present:
Expected behavior
The SDK should warn or error when
AspireCliInvocationModeis set to an unsupported value.For example, if the supported values are
Path,Dnx, andDnxPinned, then a value likeDefinitelyInvalidshould produce a diagnostic explaining the accepted values.Actual behavior
Invalid values are accepted silently. They do not produce a warning, error, or validation diagnostic, and resolution falls back to Aspire CLI mode.
Environment
Aspire.AppHost.Sdk/13.5.1