Fix Aspire.Hosting.Tests build on VS#4951
Merged
eerhardt merged 1 commit intomicrosoft:mainfrom Jul 18, 2024
Merged
Conversation
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.
eerhardt
approved these changes
Jul 18, 2024
Member
eerhardt
left a comment
There was a problem hiding this comment.
Nice find. I wonder why it doesn't fail when you duplicate the ProjectReferences like this...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When building only the
Aspire.Hosting.Testsin VS, it would fail witherrors about
ActiveIssuenot being found. This is because the projectwas being compiled with none of the dependencies from
Aspire.Components.Common.Testsgetting used in theAspire.Hosting.Testsbuild.Building the solution worked fine though.
The problem seems to be a duplicate project reference to
Aspire.Components.Common.Tests: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