跳转到内容
文档试用 Aspire
文档试用

Compiler Warning ASPIRE010

此内容尚不支持你的语言。

Version introduced: 13.5

‘[ProjectName]’ is configured with AspireUseCliBundle=false. Some Aspire features require the Aspire CLI bundle. Set AspireUseCliBundle=true to enable those features, or suppress ASPIRE010 to continue without the bundle. See https://aka.ms/aspire/diagnostics/aspire010 for more information.

This diagnostic warning is reported when an AppHost project has AspireUseCliBundle set to false (the default). Launching the AppHost directly with dotnet run or an IDE continues to work without the Aspire CLI, but features that depend on the CLI bundle — such as resolving DCP and the Aspire Dashboard from the installed Aspire CLI instead of NuGet packages — remain unavailable.

The following configuration produces ASPIRE010:

MyApp.AppHost.csproj
<PropertyGroup>
<AspireUseCliBundle>false</AspireUseCliBundle>
</PropertyGroup>

ASPIRE010 is also reported when AspireUseCliBundle isn’t set at all, because false is the default.

Set AspireUseCliBundle to true to opt in to CLI bundle delegation:

MyApp.AppHost.csproj
<PropertyGroup>
<AspireUseCliBundle>true</AspireUseCliBundle>
</PropertyGroup>

When you opt in, an explicit AspireCliPath is authoritative. Otherwise, the default Path invocation mode selects a compatible aspire on PATH, with the SDK-paired Aspire CLI package through DNX as a fallback. Setting AspireCliInvocationMode=Dnx selects the unversioned package through DNX so a tool manifest can apply, while DnxPinned selects the version paired with the AppHost SDK. AspireCliBundlePath is a bundle-layout input, not an executable invocation candidate.

An unresolved bundle layout reports ASPIRE009. ASPIRE011 is limited to the run preflight when Dnx or DnxPinned mode can’t find dnx; it doesn’t represent every CLI resolution failure.

If you intend to keep using NuGet-restored orchestration dependencies, suppress ASPIRE010:

MyApp.AppHost.csproj
<PropertyGroup>
<AspireUseCliBundle>false</AspireUseCliBundle>
<NoWarn>$(NoWarn);ASPIRE010</NoWarn>
</PropertyGroup>

For more information, see Use the Aspire CLI bundle for orchestration dependencies.