Skip to content

Commit dda45b5

Browse files
committed
Update
1 parent df982ab commit dda45b5

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Directory.Build.targets

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)Grpc.DotNet.ruleset</CodeAnalysisRuleset>
2020

2121
<IsTrimmable>true</IsTrimmable>
22-
<!-- Unable to trim netstandard2.1 projects. See https://github.com/dotnet/linker/issues/3175 -->
23-
<!-- Don't use SDK's trimming functionality. -->
24-
<_IsTrimmingEnabled>false</_IsTrimmingEnabled>
25-
<EnableAOTAnalyzer>false</EnableAOTAnalyzer>
22+
<EnableAOTAnalyzer>true</EnableAOTAnalyzer>
2623
</PropertyGroup>
2724

2825
<!-- IsGrpcPublishedPackage is set in csproj so related config must be in targets file -->
@@ -33,4 +30,18 @@
3330
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" />
3431
</ItemGroup>
3532

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+
-->
37+
<Target Name="_FixKnownILLinkPack"
38+
BeforeTargets="ProcessFrameworkReferences">
39+
<ItemGroup>
40+
<KnownILLinkPack Include="@(KnownILLinkPack)"
41+
Condition="'%(TargetFramework)' == 'net8.0'"
42+
TargetFramework="netstandard2.1"
43+
ILLinkPackVersion="%(KnownILLinkPack.ILLinkPackVersion)" />
44+
</ItemGroup>
45+
</Target>
46+
3647
</Project>

0 commit comments

Comments
 (0)