Skip to content

Commit ab81d1c

Browse files
authored
fix: Remove unnecessary dependency on System.Runtime.InteropServices.RuntimeInformation in .NET 4.6.2 builds. (#3033)
1 parent acce788 commit ab81d1c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Agent/NewRelic/Agent/Core/AgentManager.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,11 @@ private void LogInitialized()
350350
}
351351
}
352352

353-
353+
#if NETSTANDARD
354354
Log.Debug($".NET Runtime Version: {RuntimeInformation.FrameworkDescription}");
355+
#else
356+
Log.Debug($".NET Runtime Version: {AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName}");
357+
#endif
355358
}
356359

357360
#if NETFRAMEWORK

src/Agent/NewRelic/Agent/Core/Core.csproj

+1-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
<!-- .NET Framework needs to use the legacy gRPC library -->
7171
<PackageReference Include="Grpc" Version="2.46.6" />
7272
<PackageReference Include="Grpc.Core" Version="2.46.6" />
73-
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
7473
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.0" />
7574
</ItemGroup>
7675

@@ -122,7 +121,6 @@
122121
<ILRepackInclude Include="@(PossibleRefsForILRepack)" Condition="'%(FileName)' == 'System.Buffers'" />
123122
<ILRepackInclude Include="@(PossibleRefsForILRepack)" Condition="'%(FileName)' == 'System.Memory'" />
124123
<ILRepackInclude Include="@(PossibleRefsForILRepack)" Condition="'%(FileName)' == 'System.Runtime.CompilerServices.Unsafe'" />
125-
<ILRepackInclude Include="@(PossibleRefsForILRepack)" Condition="'%(FileName)' == 'System.Runtime.InteropServices.RuntimeInformation'" />
126124
<ILRepackInclude Include="@(PossibleRefsForILRepack)" Condition="'%(FileName)' == 'System.Threading.Tasks.Extensions'" />
127125
<ILRepackInclude Include="@(PossibleRefsForILRepack)" Condition="'%(FileName)' == 'System.ValueTuple'" />
128126
</ItemGroup>
@@ -137,7 +135,7 @@
137135
</ItemGroup>
138136

139137
<PropertyGroup>
140-
<ILRepackIncludeCount Condition="'$(TargetFramework)' == 'net462'">20</ILRepackIncludeCount>
138+
<ILRepackIncludeCount Condition="'$(TargetFramework)' == 'net462'">19</ILRepackIncludeCount>
141139
<ILRepackIncludeCount Condition="'$(TargetFramework)' == 'netstandard2.0'">17</ILRepackIncludeCount>
142140
</PropertyGroup>
143141

0 commit comments

Comments
 (0)