Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<StaticWebAssetBasePath>_content/TestContentPackage</StaticWebAssetBasePath>
</PropertyGroup>

<PropertyGroup Condition="'$(_SkipReferencedProjectPublishAssets)' == 'true'">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we sure _SkipReferencedProjectPublishAssets will be set here when we need it to?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like the issue is that  Components.TestServer.csproj references BasicTestApp.csproj and Components.WasmMinimal.csproj, both of which reference this project w/ identical global properties, so there's a race

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, the race is the reason for double publish. As you say, we have something like

Components.TestServer
|___BasicTestApp
|     |___TestContentPackage
|___ Components.WasmMinimal
      |___TestContentPackage

and when E2ETests.csproj is built we have both: BasicTestApp.csproj

<ProjectReference Include="..\testassets\BasicTestApp\BasicTestApp.csproj" Targets="Build;Publish" Properties="BuildProjectReferences=false;TestTrimmedApps=true;PublishDir=$(MSBuildThisFileDirectory)$(OutputPath)trimmed\BasicTestApp\" />

and Components.TestServer
<ProjectReference Include="..\testassets\Components.TestServer\Components.TestServer.csproj" Targets="Build;Publish" Properties="BuildProjectReferences=false;TestTrimmedApps=true;_SkipReferencedProjectPublishAssets=true;PublishDir=$(MSBuildThisFileDirectory)$(OutputPath)trimmed\Components.TestServer\;" />

publish triggered. The first one is missing _SkipReferencedProjectPublishAssets property, the latter has it set. That's good. That means that one of the publishes will be skipped, the other one won't. That eliminate the race. Do I get it right?

<StaticWebAssetsGetPublishAssetsTargets>_SkipGetPublishAssetsForTrimmedBuild</StaticWebAssetsGetPublishAssetsTargets>
</PropertyGroup>

<!-- No-op target used to prevent the Static Web Assets SDK from redundantly re-publishing this project. -->
<Target Name="_SkipGetPublishAssetsForTrimmedBuild" />

<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Components" />
<Reference Include="Microsoft.AspNetCore.Components.Authorization" />
Expand Down
Loading