Fix double-publish ILLink error in BasicTestApp#65675
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a build error (IL1011/NETSDK1144) that occurs when Microsoft.AspNetCore.Components.E2ETests.csproj triggers two concurrent publish runs for BasicTestApp — once directly and once transitively via Components.TestServer.csproj. The fix introduces a new opt-in MSBuild property _SkipReferencedProjectPublishAssets that, when set, redirects the Static Web Assets SDK's publish assets target to a no-op, preventing the redundant ILLink invocation.
Changes:
BasicTestApp.csproj: Adds a conditionalPropertyGroupthat overridesStaticWebAssetsGetPublishAssetsTargetsto a no-op target when_SkipReferencedProjectPublishAssets=true, along with the no-op target definition.Microsoft.AspNetCore.Components.E2ETests.csproj: Adds_SkipReferencedProjectPublishAssets=trueto thePropertiesof theComponents.TestServerProjectReferencewhen publishing in theTestTrimmedOrMultithreadingApps=truepath, so the property flows into BasicTestApp's build when invoked transitively.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj |
Adds a conditional no-op publish-assets target gated on _SkipReferencedProjectPublishAssets=true |
src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj |
Passes _SkipReferencedProjectPublishAssets=true to the Components.TestServer project reference to suppress the duplicate ILLink publish of BasicTestApp |
ilonatommy
approved these changes
Mar 6, 2026
Member
Author
|
Template test failures are unrelated, I'm investigating in #65676 |
Member
Author
|
/backport to release/10.0 |
Contributor
|
Started backporting to |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes errors like:
Microsoft.AspNetCore.Components.E2ETests.csprojreferences BasicTestApp twice - once directly, and once viaComponents.TestServer.csproj. Even thoughBuildProjectReferences=false, the latter will still try to publish BasicTestApp again due to https://github.com/dotnet/dotnet/blob/856f69955c79a685a753283ea03701c4d04264ba/src/sdk/src/StaticWebAssetsSdk/Targets/Microsoft.NET.Sdk.StaticWebAssets.Publish.targets#L116-L137. To avoid this, we can setStaticWebAssetsGetPublishAssetsTargetsto a dummy no-op target when BasicTestApp is being published via theComponents.TestServer.csprojProjectReference inMicrosoft.AspNetCore.Components.E2ETests.csproj.