Skip to content

Commit 684664a

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

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
@@ -249,11 +249,22 @@ This package is an internal implementation of the .NET Core SDK and is not meant
249249
<!-- This project doesn't compile anything. -->
250250
<Target Name="CoreCompile" />
251251

252-
<Target Name="FilterUnwantedContent">
252+
<Target Name="FilterUnwantedContent"
253+
DependsOnTargets="_ExpandRuntimePackageRoot">
253254
<ItemGroup>
254255
<!-- These files end up in this item group as a result of setting CopyLocalLockFileAssemblies, but shouldn't be. -->
255256
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(FileName)' == 'apphost' OR '%(FileName)' == '$(LibPrefix)hostfxr' OR '%(FileName)' == '$(LibPrefix)hostpolicy' "/>
256257
</ItemGroup>
258+
259+
<ItemGroup>
260+
<RuntimePackageFiles Include="$(RuntimePackageRoot)runtimes\**\*" />
261+
<!--
262+
Filter out any overlap between our SharedFx (ReferenceCopyLocalPaths) and dotnet/runtime's SharedFx (RuntimePackageFiles).
263+
Most of the time there is no overlap, but in certain rare corner cases there can be.
264+
See https://github.com/dotnet/aspnetcore/issues/45033 for more detail.
265+
-->
266+
<ReferenceCopyLocalPaths Remove="@(RuntimePackageFiles)" MatchOnMetadata="FileName"/>
267+
</ItemGroup>
257268
</Target>
258269

259270
<Target Name="_WarnAboutUnbuiltNativeDependencies"
@@ -385,7 +396,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
385396

386397
<Target Name="PrepareForCrossGen"
387398
Condition="'$(CrossgenOutput)' == 'true'"
388-
DependsOnTargets="_ExpandRuntimePackageRoot">
399+
DependsOnTargets="FilterUnwantedContent">
389400
<!-- The output directories of assemblies built in this repo contain a mix of ref and impl assemblies. Copy impl assemblies to a separate directory. -->
390401
<RemoveDir Directories="$(CrossgenPlatformAssembliesDir)" />
391402
<Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFolder="$(CrossgenPlatformAssembliesDir)" Condition="'%(ReferenceCopyLocalPaths.ProjectPath)' != ''"/>
@@ -426,10 +437,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
426437
File="$(CrossgenToolDir)PlatformAssembliesPathsCrossgen2.rsp"
427438
Overwrite="true" />
428439

429-
<ItemGroup>
430-
<RuntimePackageFiles Include="$(RuntimePackageRoot)runtimes\**\*" />
431-
</ItemGroup>
432-
433440
<Error Text="Could not find crossgen2 $(CrossgenToolPath)" Condition=" ! Exists($(CrossgenToolPath))" />
434441

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

0 commit comments

Comments
 (0)