跳转到内容

Compiler Warning ASPIRE004

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

Version introduced: 8.0.0

The Project reference isn’t to an executable project, so won’t be launched. Did you mean to set IsAspireProjectResource=“false”?

The project being referenced by the Aspire AppHost isn’t an executable, but is being treated like one for the purposes of orchestration.

Either change the build type of the project to an executable, or add the IsAspireProjectResource="false" setting to the project reference in your Aspire AppHost project file, as demonstrated in the following snippet:

C# project file
<ItemGroup>
<ProjectReference Include="..\OtherProjects\Contracts.csproj" IsAspireProjectResource="false" />
</ItemGroup>

Suppress the warning with either of the following methods:

  • Set the severity of the rule in the .editorconfig file.

    .editorconfig
    [*.{cs,vb}]
    dotnet_diagnostic.ASPIRE004.severity = none

    For more information about editor config files, see Configuration files for code analysis rules.

  • Add the following PropertyGroup to your project file:

    <PropertyGroup>
    <NoWarn>$(NoWarn);ASPIRE004</NoWarn>
    </PropertyGroup>
问 & 答协作社区讨论观看