Skip to content

Commit

Permalink
Try to remove netcoreapp2.0 from Elastic.Apm.Profiler.Managed.Loader (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz authored Oct 25, 2024
1 parent 582d500 commit df7825d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build/scripts/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ module Build =
|> Seq.map DirectoryInfo
|> Seq.iter (copyDllsAndPdbs (agentDir.CreateSubdirectory(sprintf "%i.0.0" oldDiagnosticSourceVersion.Major)))

// assemblies compiled against 6.0 version of System.Diagnostics.DiagnosticSource
!! (Paths.BuildOutput (sprintf "Elastic.Apm.StartupHook.Loader_%i.0.0/netstandard2.0" oldDiagnosticSourceVersion.Major)) //using old version here, because it the netcoreapp2.2 app can't build with diagnosticsource6
// assemblies compiled against 6.0 version of System.Diagnostics.DiagnosticSource
!! (Paths.BuildOutput (sprintf "Elastic.Apm.StartupHook.Loader_%i.0.0/netstandard2.0" oldDiagnosticSourceVersion.Major))
++ (Paths.BuildOutput (sprintf "Elastic.Apm_%i.0.0/net6.0" diagnosticSourceVersion6.Major))
|> Seq.filter Path.isDirectory
|> Seq.map DirectoryInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>Elastic.Apm.Profiler.Managed.Loader</RootNamespace>
<TargetFrameworks>net462;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<IsPackable>false</IsPackable>
<DefineConstants>$(DefineConstants);PROFILER_MANAGED_LOADER</DefineConstants>
Expand All @@ -15,6 +15,9 @@
<Compile Include="$(SolutionRoot)src/Elastic.Apm/Logging/GlobalLogConfiguration.cs" />
<Compile Include="$(SolutionRoot)src/Elastic.Apm/Logging/LogLevel.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.Loader" />
</ItemGroup>

<!-- delete everything but the dlls and pdbs when building in release configuration. The bin directory contents
are embedded in the profiler binary, so don't embed unneccessary files -->
Expand Down
2 changes: 1 addition & 1 deletion src/profiler/elastic_apm_profiler/src/profiler/managed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub extern "C" fn GetAssemblyAndSymbolsBytes(
let tfm = if IS_DESKTOP_CLR.load(Ordering::SeqCst) {
"net462"
} else {
"netcoreapp2.0"
"netstandard2.0"
};
let a =
ManagedLoader::get(&format!("{}/{}.dll", tfm, MANAGED_PROFILER_ASSEMBLY_LOADER)).unwrap();
Expand Down

0 comments on commit df7825d

Please sign in to comment.