Skip to content

Commit 4bf9312

Browse files
authored
Trimming issue workaround in .NET 8 (#2022)
1 parent 0a26b0c commit 4bf9312

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Directory.Build.targets

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,19 @@
3030
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" />
3131
</ItemGroup>
3232

33+
<!--
34+
Make a netstandard2.1 copy of the .net ILLinkPack to work around a trimming issue.
35+
See https://github.com/dotnet/linker/issues/3175
36+
TODO: Remove once .NET 8 + trimming + netstandard2.1 is fixed.
37+
-->
38+
<Target Name="_FixKnownILLinkPack"
39+
BeforeTargets="ProcessFrameworkReferences">
40+
<ItemGroup>
41+
<KnownILLinkPack Include="@(KnownILLinkPack)"
42+
Condition="'%(TargetFramework)' == 'net8.0'"
43+
TargetFramework="netstandard2.1"
44+
ILLinkPackVersion="%(KnownILLinkPack.ILLinkPackVersion)" />
45+
</ItemGroup>
46+
</Target>
47+
3348
</Project>

0 commit comments

Comments
 (0)