Skip to content

Commit 6177093

Browse files
authored
Reference Roslyn ref assemblies when available when building a targeting pack (#15209)
1 parent e8d1fc3 commit 6177093

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Microsoft.DotNet.SharedFramework.Sdk/targets/sharedfx.targets

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
ResolveFrameworkReferences;
101101
ResolveLockFileCopyLocalFiles;
102102
ResolveReferences;
103+
FindReferenceAssembliesForReferences;
103104
_ReadyToRunSharedFramework;
104105
_FindSymbolFilesForSharedFrameworkFiles"
105106
Returns="@(FilesToPackage)">
@@ -122,12 +123,18 @@
122123
</ItemGroup>
123124

124125
<ItemGroup Condition="'$(PlatformPackageType)' == 'TargetingPack'">
125-
<FilesToPackage Include="@(ReferencePath)" Condition="'%(ReferencePath.FrameworkReferenceName)' == ''">
126+
<!-- include all doc files from explicitly added files to package -->
127+
<DocFilesToPackage Include="%(FilesToPackage.RootDir)%(FilesToPackage.Directory)**\%(FilesToPackage.FileName).xml" />
128+
129+
<FilesToPackage Include="@(ReferencePath->Metadata('ReferenceAssembly'))" Condition="'%(ReferencePath.FrameworkReferenceName)' == ''">
126130
<TargetPath>ref/$(TargetFramework)</TargetPath>
127131
</FilesToPackage>
128132

129-
<!-- include all doc files -->
130-
<DocFilesToPackage Include="%(FilesToPackage.RootDir)%(FilesToPackage.Directory)**\%(FilesToPackage.FileName).xml" />
133+
<!--
134+
Include all doc files from referenced assemblies.
135+
We need to do this separately as the Roslyn-generated ref assembly is in the wrong folder, so we wouldn't find doc files in that case.
136+
-->
137+
<DocFilesToPackage Include="%(ReferencePath.RootDir)%(ReferencePath.Directory)**\%(ReferencePath.FileName).xml" />
131138

132139
<FilesToPackage Include="@(DocFilesToPackage)">
133140
<TargetPath>ref/$(TargetFramework)/%(RecursiveDir)</TargetPath>

0 commit comments

Comments
 (0)