Skip to content

Commit a1452da

Browse files
[release/6.0] Explicitly de-dupe ReferenceCopyLocalPaths in Microsoft.AspNetCore.App.Runtime.csproj (#45333)
* Test removing dupe filenames * Get it working * Fixup * Use _'d names * Use MatchOnMetadata * Change dependendsOn Co-authored-by: Will Godbe <[email protected]>
1 parent 2d551e3 commit a1452da

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,22 @@ This package is an internal implementation of the .NET Core SDK and is not meant
225225
<!-- This project doesn't compile anything. -->
226226
<Target Name="CoreCompile" />
227227

228-
<Target Name="FilterUnwantedContent">
228+
<Target Name="FilterUnwantedContent"
229+
DependsOnTargets="_ExpandRuntimePackageRoot">
229230
<ItemGroup>
230231
<!-- These files end up in this item group as a result of setting CopyLocalLockFileAssemblies, but shouldn't be. -->
231232
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(FileName)' == 'apphost' OR '%(FileName)' == '$(LibPrefix)hostfxr' OR '%(FileName)' == '$(LibPrefix)hostpolicy' "/>
232233
</ItemGroup>
234+
235+
<ItemGroup>
236+
<RuntimePackageFiles Include="$(RuntimePackageRoot)runtimes\**\*" />
237+
<!--
238+
Filter out any overlap between our SharedFx (ReferenceCopyLocalPaths) and dotnet/runtime's SharedFx (RuntimePackageFiles).
239+
Most of the time there is no overlap, but in certain rare corner cases there can be.
240+
See https://github.com/dotnet/aspnetcore/issues/45033 for more detail.
241+
-->
242+
<ReferenceCopyLocalPaths Remove="@(RuntimePackageFiles)" MatchOnMetadata="FileName"/>
243+
</ItemGroup>
233244
</Target>
234245

235246
<Target Name="_WarnAboutUnbuiltNativeDependencies"
@@ -369,7 +380,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
369380

370381
<Target Name="PrepareForCrossGen"
371382
Condition="'$(CrossgenOutput)' == 'true'"
372-
DependsOnTargets="_ExpandRuntimePackageRoot">
383+
DependsOnTargets="FilterUnwantedContent">
373384
<!-- The output directories of assemblies built in this repo contain a mix of ref and impl assemblies. Copy impl assemblies to a separate directory. -->
374385
<RemoveDir Directories="$(CrossgenPlatformAssembliesDir)" />
375386
<Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFolder="$(CrossgenPlatformAssembliesDir)" Condition="'%(ReferenceCopyLocalPaths.ProjectPath)' != ''"/>
@@ -410,10 +421,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
410421
File="$(CrossgenToolDir)PlatformAssembliesPathsCrossgen2.rsp"
411422
Overwrite="true" />
412423

413-
<ItemGroup>
414-
<RuntimePackageFiles Include="$(RuntimePackageRoot)runtimes\**\*" />
415-
</ItemGroup>
416-
417424
<Error Text="Could not find crossgen2 $(CrossgenToolPath)" Condition=" ! Exists($(CrossgenToolPath))" />
418425

419426
<!-- Create tool directory with runtime assemblies -->

0 commit comments

Comments
 (0)