Skip to content

Fix Aspire.Hosting.Tests build on VS#4951

Merged
eerhardt merged 1 commit intomicrosoft:mainfrom
radical:fix-main-vs
Jul 18, 2024
Merged

Fix Aspire.Hosting.Tests build on VS#4951
eerhardt merged 1 commit intomicrosoft:mainfrom
radical:fix-main-vs

Conversation

@radical
Copy link
Copy Markdown
Member

@radical radical commented Jul 18, 2024

When building only the Aspire.Hosting.Tests in VS, it would fail with
errors about ActiveIssue not being found. This is because the project
was being compiled with none of the dependencies from
Aspire.Components.Common.Tests getting used in the
Aspire.Hosting.Tests build.

Building the solution worked fine though.

The problem seems to be a duplicate project reference to
Aspire.Components.Common.Tests:

<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" IsAspireProjectResource="false" />

<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" />

Removing the second reference fixes the issue. I'm not sure why this
broke VS though.

Note that this works perfectly find on command line, whether building the whole solution or just the tests project on Windows, and macOS.

Microsoft Reviewers: Open in CodeFlow

When building only the `Aspire.Hosting.Tests` in VS, it would fail with
errors about `ActiveIssue` not being found. This is because the project
was being compiled with none of the dependencies from
`Aspire.Components.Common.Tests` getting used in the
`Aspire.Hosting.Tests` build.

Building the solution worked fine though.

The problem seems to be a duplicate project reference to
`Aspire.Components.Common.Tests`:

```
<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" IsAspireProjectResource="false" />

<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" />
```

Removing the second reference fixes the issue. I'm not sure *why* this
broke VS though.
@radical radical requested a review from eerhardt July 18, 2024 00:49
@radical radical requested a review from mitchdenny as a code owner July 18, 2024 00:49
@ghost ghost added the area-integrations Issues pertaining to Aspire Integrations packages label Jul 18, 2024
@radical radical requested a review from joperezr July 18, 2024 00:50
Copy link
Copy Markdown
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find. I wonder why it doesn't fail when you duplicate the ProjectReferences like this...

@eerhardt eerhardt merged commit 640c450 into microsoft:main Jul 18, 2024
@radical radical deleted the fix-main-vs branch July 18, 2024 02:58
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants