Skip to content

Commit

Permalink
Add initial check for missing Aspire.Hosting package (#512)
Browse files Browse the repository at this point in the history
* Add initial check for missing Aspire.Hosting package

* Update to be consistent with other proposed build warnings

* AppHost instead of Host
  • Loading branch information
danegsta authored Oct 26, 2023
1 parent d3ce4ad commit caa49f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Aspire.Hosting.Sdk/SDK/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

<!-- *** END *** -->

<Target Name="__WarnOnAspireCapabilityMissing" BeforeTargets="PrepareForBuild" Condition="!@(ProjectCapability->AnyHaveMetadataValue('Identity', 'Aspire'))">
<Warning Code="ASPIRE002" Text="$(MSBuildProjectName) is an Aspire AppHost project but necessary dependencies aren't present. Are you missing an Aspire.Hosting PackageReference?" />
</Target>

<!--
This SDK comes from a workload pack, so normally should only be referenced from
the WorkloadManifest.targets so as not to cause workload restore to require multiple
Expand Down

0 comments on commit caa49f4

Please sign in to comment.