diff --git a/OpenTelemetry.AutoInstrumentation.sln b/OpenTelemetry.AutoInstrumentation.sln index 3711aff47f..82aca1695c 100644 --- a/OpenTelemetry.AutoInstrumentation.sln +++ b/OpenTelemetry.AutoInstrumentation.sln @@ -95,8 +95,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.AutoInstrumen EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApplication.Smoke", "test\test-applications\integrations\TestApplication.Smoke\TestApplication.Smoke.csproj", "{FF665CC4-6643-4614-A1A0-FA182E3AF37C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.AutoInstrumentation.AdditionalDeps", "src\OpenTelemetry.AutoInstrumentation.AdditionalDeps\OpenTelemetry.AutoInstrumentation.AdditionalDeps.csproj", "{E026D9FA-FBD5-4066-AF6A-FB63DE28521F}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.AutoInstrumentation.Tests", "test\OpenTelemetry.AutoInstrumentation.Tests\OpenTelemetry.AutoInstrumentation.Tests.csproj", "{065FEB4E-A99E-4A59-8112-1CB30CF794F9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApplication.Http", "test\test-applications\integrations\TestApplication.Http\TestApplication.Http.csproj", "{4E17BE29-B227-41D8-97FE-26F674951E26}" @@ -254,7 +252,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication.ProfilerSpa EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication.NoCode", "test\test-applications\integrations\TestApplication.NoCode\TestApplication.NoCode.csproj", "{500BF40F-EECB-4F6A-377B-EDBDFFDE09BE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework", "src\OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework\OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework.csproj", "{B69564D4-7D5B-7147-6CBA-233BB8A33C50}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTelemetry.AutoInstrumentation.Assemblies", "src\OpenTelemetry.AutoInstrumentation.Assemblies\OpenTelemetry.AutoInstrumentation.Assemblies.csproj", "{B69564D4-7D5B-7147-6CBA-233BB8A33C50}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication.Wcf.Core", "test\test-applications\integrations\TestApplication.Wcf.Core\TestApplication.Wcf.Core.csproj", "{0F864722-CE44-4D99-9B67-CF0ED1893FF1}" EndProject @@ -502,22 +500,6 @@ Global {FF665CC4-6643-4614-A1A0-FA182E3AF37C}.Release|x64.Build.0 = Release|x64 {FF665CC4-6643-4614-A1A0-FA182E3AF37C}.Release|x86.ActiveCfg = Release|x86 {FF665CC4-6643-4614-A1A0-FA182E3AF37C}.Release|x86.Build.0 = Release|x86 - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Debug|ARM64.Build.0 = Debug|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Debug|x64.ActiveCfg = Debug|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Debug|x64.Build.0 = Debug|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Debug|x86.ActiveCfg = Debug|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Debug|x86.Build.0 = Debug|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Release|Any CPU.Build.0 = Release|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Release|ARM64.ActiveCfg = Release|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Release|ARM64.Build.0 = Release|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Release|x64.ActiveCfg = Release|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Release|x64.Build.0 = Release|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Release|x86.ActiveCfg = Release|Any CPU - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F}.Release|x86.Build.0 = Release|Any CPU {065FEB4E-A99E-4A59-8112-1CB30CF794F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {065FEB4E-A99E-4A59-8112-1CB30CF794F9}.Debug|Any CPU.Build.0 = Debug|Any CPU {065FEB4E-A99E-4A59-8112-1CB30CF794F9}.Debug|ARM64.ActiveCfg = Debug|Any CPU @@ -1662,7 +1644,6 @@ Global {35AB65D8-D76E-40C6-B10C-501A6D44C9E0} = {5C915382-C886-457D-8641-9E766D8E5A17} {E04DA938-E153-4A0D-9CB0-EAC38210FAF2} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB} {FF665CC4-6643-4614-A1A0-FA182E3AF37C} = {E409ADD3-9574-465C-AB09-4324D205CC7C} - {E026D9FA-FBD5-4066-AF6A-FB63DE28521F} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB} {065FEB4E-A99E-4A59-8112-1CB30CF794F9} = {5C915382-C886-457D-8641-9E766D8E5A17} {4E17BE29-B227-41D8-97FE-26F674951E26} = {E409ADD3-9574-465C-AB09-4324D205CC7C} {3B77F975-BF66-4218-9982-F48D3271DDFE} = {E409ADD3-9574-465C-AB09-4324D205CC7C} diff --git a/build/AssemblyRedirectionSourceGenerator.cs b/build/AssemblyRedirectionSourceGenerator.cs index 35a7860393..3ea3b35d85 100644 --- a/build/AssemblyRedirectionSourceGenerator.cs +++ b/build/AssemblyRedirectionSourceGenerator.cs @@ -5,28 +5,31 @@ public static class AssemblyRedirectionSourceGenerator { - public static void Generate(string assembliesFolderPath, string generatedFilePath) + public static void Generate( + string assembliesFolderPath, + string generatedFilePath, + Regex versionRegex, + Func versionNormalizer) { Log.Debug("Generating assembly redirection file {0}", generatedFilePath); + + var macroName = Path.GetFileNameWithoutExtension(generatedFilePath).ToUpperInvariant(); + var assemblies = new SortedDictionary>(); var folders = new Dictionary(); - var frameworkVersionRegEx = new Regex(@"^net(?\d{2,3})$"); + // Discover framework-specific subfolders foreach (var directory in Directory.EnumerateDirectories(assembliesFolderPath)) { var folderName = Path.GetFileName(directory); - var framework = frameworkVersionRegEx.Match(folderName).Groups["version"].Value; + var framework = versionNormalizer(versionRegex.Match(folderName).Groups); if (framework == string.Empty) { Log.Error("Unexpected folder name: {0}, will not be processed", framework); continue; } var frameworkVersion = int.Parse(framework); - if (frameworkVersion < 100) - { - frameworkVersion *= 10; - } if (folders.TryGetValue(frameworkVersion, out var folder)) { @@ -49,7 +52,6 @@ void Process(string fileName, int? framework) return; } - foreach (var keys in framework != null ? (IEnumerable)[framework.Value] : assemblies.Keys) { assemblies[keys][assemblyDef.Name] = assemblyDef; @@ -63,11 +65,13 @@ void Process(string fileName, int? framework) } } + // Process common assemblies in root folder foreach (var fileName in Directory.EnumerateFiles(assembliesFolderPath)) { Process(fileName, null); } + // Process framework-specific assemblies foreach (var fx in folders) { foreach (var fileName in Directory.EnumerateFiles(fx.Value)) @@ -83,13 +87,13 @@ void Process(string fileName, int? framework) } } - var sourceContents = GenerateSourceContents(assemblies); + var sourceContents = GenerateSourceContents(assemblies, macroName); File.WriteAllText(generatedFilePath, sourceContents); Log.Information("Assembly redirection source generated {0}", generatedFilePath); } - private static string GenerateSourceContents(SortedDictionary> assemblies) + private static string GenerateSourceContents(SortedDictionary> assemblies, string macroName) { #pragma warning disable format return @@ -101,25 +105,16 @@ private static string GenerateSourceContents(SortedDictionary { - foreach (var project in Solution.GetManagedSrcProjects().Where(p => !p.Name.EndsWith("AdditionalDeps") && !p.Name.Contains("Assemblies"))) + foreach (var project in Solution.GetManagedSrcProjects().Where(p => !p.Name.EndsWith("Assemblies"))) { DotNetPack(x => x .SetProject(project) diff --git a/build/Build.Steps.Windows.cs b/build/Build.Steps.Windows.cs index b5b4bec1b2..53bbfe2891 100644 --- a/build/Build.Steps.Windows.cs +++ b/build/Build.Steps.Windows.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.IO; using Nuke.Common; using Nuke.Common.IO; using Nuke.Common.ProjectModel; @@ -19,7 +16,7 @@ partial class Build Target CompileNativeSrcWindows => _ => _ .Unlisted() .After(CompileManagedSrc) - .After(GenerateNetFxAssemblyRedirectionSource) + .After(GenerateAssemblyRedirectionSource) .OnlyWhenStatic(() => IsWin) .Executes(() => { @@ -74,7 +71,7 @@ static void SupportVs2026IfAvailable() Target CompileNativeDependenciesForManagedTestsWindows => _ => _ .Unlisted() .After(CompileManagedSrc) - .After(GenerateNetFxAssemblyRedirectionSource) + .After(GenerateAssemblyRedirectionSource) .OnlyWhenStatic(() => IsWin) .Executes(() => { @@ -228,31 +225,6 @@ void BuildDockerImage(Project project, params string[] targets) } } - Target GenerateNetFxTransientDependencies => _ => _ - .Unlisted() - .After(Restore) - .OnlyWhenStatic(() => IsWin) - .Executes(() => - { - // The target project needs to have its NuGet packages restored prior to running the tool. - var targetProject = Solution.GetProjectByName(Projects.AutoInstrumentationNetFxAssemblies); - DotNetRestore(s => s.SetProjectFile(targetProject)); - - TransientDependenciesGenerator.Run(targetProject); - }); - - Target GenerateNetFxAssemblyRedirectionSource => _ => _ - .Unlisted() - .After(PublishManagedProfiler) - .OnlyWhenStatic(() => IsWin) - .Executes(() => - { - var netFxAssembliesFolder = TracerHomeDirectory / MapToFolderOutput(TargetFramework.NET462); - var generatedSourceFile = SourceDirectory / Projects.AutoInstrumentationNative / "netfx_assembly_redirection.h"; - - AssemblyRedirectionSourceGenerator.Generate(netFxAssembliesFolder, generatedSourceFile); - }); - Target InstallNetFxAssembliesGAC => _ => _ .Unlisted() .After(BuildTracer) @@ -279,8 +251,9 @@ private void RunNetFxGacOperation(string operation) } // We assume that dev machine running test has .Net Framework not older than TargetFrameworksNetFx.Last() - var netFxCommonAssembliesFolder = TracerHomeDirectory / MapToFolderOutput(TargetFrameworksForNetFxPacking.Last()); - var netFxAssembliesFolder = TracerHomeDirectory / MapToFolderOutputNetFx(TargetFrameworksForNetFxPacking.Last()); + var lastFramework = TargetFrameworksForNetFxPacking.Last(); + var netFxCommonAssembliesFolder = TracerHomeDirectory / lastFramework.OutputFolder; + var netFxAssembliesFolder = TracerHomeDirectory / lastFramework.OutputFolder / lastFramework; var installTool = Solution.GetProjectByName(Projects.Tools.GacInstallTool); DotNetRun(s => s diff --git a/build/Build.Steps.cs b/build/Build.Steps.cs index 537e89dcc5..d252d9b0c1 100644 --- a/build/Build.Steps.cs +++ b/build/Build.Steps.cs @@ -1,9 +1,8 @@ using System.Diagnostics; -using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Text; using System.Text.Json; -using System.Text.Json.Nodes; +using System.Text.RegularExpressions; using Extensions; using Nuke.Common; using Nuke.Common.IO; @@ -29,8 +28,6 @@ partial class Build AbsolutePath TracerHomeDirectory => TracerHome ?? (OutputDirectory / "tracer-home"); AbsolutePath TestArtifactsDirectory => RootDirectory / "test-artifacts"; AbsolutePath ProfilerTestLogs => TestArtifactsDirectory / "profiler-logs"; - AbsolutePath AdditionalDepsDirectory => TracerHomeDirectory / "AdditionalDeps"; - AbsolutePath StoreDirectory => TracerHomeDirectory / "store"; Project NativeProfilerProject => Solution.GetProjectByName(Projects.AutoInstrumentationNative); @@ -40,25 +37,40 @@ partial class Build IEnumerable ArchitecturesForPlatform => Equals(Platform, MSBuildTargetPlatform.x64) - ? new[] { MSBuildTargetPlatform.x64, MSBuildTargetPlatform.x86 } - : new[] { MSBuildTargetPlatform.x86 }; + ? [MSBuildTargetPlatform.x64, MSBuildTargetPlatform.x86] + : [MSBuildTargetPlatform.x86]; - private static readonly IEnumerable TargetFrameworks = new[] - { + private static readonly IEnumerable TargetFrameworks = + [ TargetFramework.NET8_0, TargetFramework.NET462, - }; + ]; - private static readonly IEnumerable TargetFrameworksForNetFxPacking = new[] - { + private static readonly IEnumerable TargetFrameworksForNetFxPacking = + [ TargetFramework.NET462, TargetFramework.NET47, TargetFramework.NET471, TargetFramework.NET472, - }; + ]; - private static readonly IEnumerable TestFrameworks = TargetFrameworks - .Concat(TargetFramework.NET9_0, TargetFramework.NET10_0); + private static readonly IEnumerable TargetFrameworksForPublish = + [ + TargetFramework.NET462, + TargetFramework.NET47, + TargetFramework.NET471, + TargetFramework.NET472, + TargetFramework.NET8_0, + TargetFramework.NET9_0, + TargetFramework.NET10_0 + ]; + + private static readonly IEnumerable TestFrameworks = + [ + ..TargetFrameworks, + TargetFramework.NET9_0, + TargetFramework.NET10_0 + ]; Target CreateRequiredDirectories => _ => _ .Unlisted() @@ -115,9 +127,21 @@ DotNetRestoreSettings Restore(DotNetRestoreSettings s) => } })); + Target GenerateTransientDependencies => _ => _ + .Unlisted() + .After(Restore) + .Executes(() => + { + // The target project needs to have its NuGet packages restored prior to running the tool. + var targetProject = Solution.GetProjectByName(Projects.AutoInstrumentationAssemblies); + DotNetRestore(s => s.SetProjectFile(targetProject)); + + TransientDependenciesGenerator.Run(targetProject); + }); + Target CompileManagedSrc => _ => _ .Description("Compiles the managed code in the src directory") - .After(GenerateNetFxTransientDependencies) + .After(GenerateTransientDependencies) .After(CreateRequiredDirectories) .After(Restore) .Executes(() => @@ -272,120 +296,64 @@ DotNetBuildSettings BuildTestApplication(DotNetBuildSettings x, string targetFra Target PublishManagedProfiler => _ => _ .Unlisted() .After(CompileManagedSrc) - .DependsOn(CopyAdditionalDeps) .Executes(() => { var targetFrameworks = IsWin - ? TargetFrameworks - : TargetFrameworks.ExceptNetFramework(); + ? TargetFrameworksForPublish + : TargetFrameworksForPublish.ExceptNetFramework(); - // Publish Projects.AutoInstrumentation for .NET targets + // Publish OpenTelemetry.AutoInstrumentation.Assemblies for all target frameworks DotNetPublish(s => s - .SetProject(Solution.GetProjectByName(Projects.AutoInstrumentation)) + .SetProject(Solution.GetProjectByName(Projects.AutoInstrumentationAssemblies)) .SetConfiguration(BuildConfiguration) .SetTargetPlatformAnyCPU() .EnableNoBuild() .SetNoRestore(NoRestore) - .CombineWith(targetFrameworks.ExceptNetFramework(), (p, framework) => p + .CombineWith(targetFrameworks, (p, framework) => p .SetFramework(framework) - .SetOutput(TracerHomeDirectory / MapToFolderOutput(framework)))); - - if (IsWin) - { - // Publish OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework for .NET Framework targets - DotNetPublish(s => s - .SetProject(Solution.GetProjectByName(Projects.AutoInstrumentationNetFxAssemblies)) - .SetConfiguration(BuildConfiguration) - .SetTargetPlatformAnyCPU() - .EnableNoBuild() - .SetNoRestore(NoRestore) - .CombineWith(TargetFrameworksForNetFxPacking, (p, framework) => p - .SetFramework(framework) - .SetOutput(TracerHomeDirectory / MapToFolderOutputNetFx(framework)))); - } - - // StartupHook is supported starting .Net Core 3.1. - // We need to emit AutoInstrumentationStartupHook for .Net Core 3.1 target framework - // to avoid application crash with .Net Core 3.1 and .NET 5.0 apps. - DotNetPublish(s => s - .SetProject(Solution.GetProjectByName(Projects.AutoInstrumentationStartupHook)) - .SetConfiguration(BuildConfiguration) - .SetTargetPlatformAnyCPU() - .EnableNoBuild() - .SetNoRestore(NoRestore) - .SetFramework(TargetFramework.NETCore3_1) - .SetOutput(TracerHomeDirectory / MapToFolderOutput(TargetFramework.NETCore3_1))); + .SetOutput(TracerHomeDirectory / framework.OutputFolder / framework))); - // AutoInstrumentationLoader publish is needed only for .NET 8.0 to support load from AutoInstrumentationStartupHook. - DotNetPublish(s => s - .SetProject(Solution.GetProjectByName(Projects.AutoInstrumentationLoader)) - .SetConfiguration(BuildConfiguration) - .SetTargetPlatformAnyCPU() - .EnableNoBuild() - .SetNoRestore(NoRestore) - .SetFramework(TargetFramework.NET8_0) - .SetOutput(TracerHomeDirectory / MapToFolderOutput(TargetFramework.NET8_0))); + AssertTracerHomeAssemblies(targetFrameworks); - DotNetPublish(s => s - .SetProject(Solution.GetProjectByName(Projects.AutoInstrumentationAspNetCoreBootstrapper)) - .SetConfiguration(BuildConfiguration) - .SetTargetPlatformAnyCPU() - .EnableNoBuild() - .SetNoRestore(NoRestore) - .SetFramework(TargetFramework.NET8_0) - .SetOutput(TracerHomeDirectory / MapToFolderOutput(TargetFramework.NET8_0))); - - RemoveFilesInNetFolderAvailableInAdditionalStore(); - - RemoveNonLibraryFilesFromOutput(); + CleanupTracerHomeAssemblies(); - RemoveDuplicateNetFxLibraries(); + OptimizeTracerHomeAssemblies(targetFrameworks); }); - void RemoveNonLibraryFilesFromOutput() + void AssertTracerHomeAssemblies(IEnumerable frameworks) { - TracerHomeDirectory.GlobFiles("**/*.xml").ForEach(file => file.DeleteFile()); - (TracerHomeDirectory / "net").GlobFiles("*.json").ForEach(file => file.DeleteFile()); - if (IsWin) + // Check that all target framework directories exist + var missingDirectories = frameworks + .Select(it => TracerHomeDirectory / it.OutputFolder / it) + .Where(it => !it.DirectoryExists()) + .ToList(); + + if (missingDirectories.Count > 0) { - (TracerHomeDirectory / "netfx").GlobFiles("*.json").ForEach(file => file.DeleteFile()); + throw new InvalidOperationException($"Missing framework directories: [{string.Join(", ", missingDirectories)}]"); } - } - - void RemoveFilesInNetFolderAvailableInAdditionalStore() - { - Log.Debug("Removing files available in additional store from net folder"); - var netFolder = TracerHomeDirectory / "net"; - var additionalStoreFolder = TracerHomeDirectory / "store"; - var netLibraries = netFolder.GlobFiles("**/*.dll"); - var netLibrariesByName = netLibraries.ToDictionary(x => x.Name); - var additionalStoreLibraries = additionalStoreFolder.GlobFiles("**/*.dll"); + // Check that there are no nested directories in target framework folders + var problematicDirectories = frameworks + .Select(it => TracerHomeDirectory / it.OutputFolder / it) + .Where(it => it.GlobDirectories("*").Count != 0) + .ToList(); - foreach (var additionalStoreLibrary in additionalStoreLibraries) + if (problematicDirectories.Count > 0) { - if (netLibrariesByName.TryGetValue(additionalStoreLibrary.Name, out var netLibrary)) - { - var netLibraryFileVersionInfo = FileVersionInfo.GetVersionInfo(netLibrary); - var additionalStoreLibraryFileVersionInfo = FileVersionInfo.GetVersionInfo(additionalStoreLibrary); - - if (netLibraryFileVersionInfo.FileVersion == additionalStoreLibraryFileVersionInfo.FileVersion) - { - Log.Debug("Delete file available in additional store from net folder " + additionalStoreLibrary.Name + " version: " + netLibraryFileVersionInfo.FileVersion); - netLibrary.DeleteFile(); - netLibrariesByName.Remove(additionalStoreLibrary.Name); - } - else - { - Log.Warning("Cannot remove file available in additional store from net folder " + additionalStoreLibrary.Name + " net folder version: " + netLibraryFileVersionInfo.FileVersion + " additional store version: " + additionalStoreLibraryFileVersionInfo.FileVersion); - } - } + throw new InvalidOperationException($"Loader expects flat framework directories. Subdirectories found in: [{string.Join(", ", problematicDirectories)}]"); } } - void RemoveDuplicateNetFxLibraries() + void CleanupTracerHomeAssemblies() + { + // remove unnecessary files that may come with target frameworks dependencies + TracerHomeDirectory.GlobFiles("**/*.xml", "**/*.json", "**/*.dylib", "**/*.so").ForEach(file => file.DeleteFile()); + } + + void OptimizeTracerHomeAssemblies(IEnumerable frameworks) { - bool FilesAreEqual(string filePath1, string filePath2) + static bool FilesAreEqual(string filePath1, string filePath2) { using var hashAlg = SHA256.Create(); using var stream1 = File.OpenRead(filePath1); @@ -397,58 +365,83 @@ bool FilesAreEqual(string filePath1, string filePath2) return hash1.SequenceEqual(hash2); } - if (IsWin) + // process framework groups separately: .NET Frameworks (/netfx folder) vs .NET (Core) (/net folder) + // move all duplicated libraries from framework-specific folders to base folder + foreach (var group in frameworks.GroupBy(it => it.OutputFolder)) { - (TracerHomeDirectory / "netfx").GlobFiles("**/*.link").DeleteFiles(); - (TracerHomeDirectory / "netfx").GlobFiles("**/_._").DeleteFiles(); - var latestFramework = TargetFramework.NetFramework.Last(); - (TracerHomeDirectory / "netfx" / latestFramework).GlobFiles("*.*") - .Where(file => TargetFramework.NetFramework.TakeUntil(older => older == latestFramework) - .All(olderFramework => - { - var duplicateCandidate = TracerHomeDirectory / "netfx" / olderFramework / file.Name; - return File.Exists(duplicateCandidate) && FilesAreEqual(file, duplicateCandidate); - })).ForEach(file => - { - file.MoveToDirectory(TracerHomeDirectory / "netfx", ExistsPolicy.FileOverwrite); - TargetFramework.NetFramework.TakeUntil(older => older == latestFramework) - .ForEach(olderFramework => - (TracerHomeDirectory / "netfx" / olderFramework / file.Name).DeleteFile()); - } - ); + var baseDirectory = TracerHomeDirectory / group.Key; + var frameworkList = group.ToList(); - foreach (var currentFramework in TargetFramework.NetFramework.Skip(1).Reverse()) - { - (TracerHomeDirectory / "netfx" / currentFramework).GlobFiles("*.dll").ForEach(file => + baseDirectory.GlobFiles("**/*.link", "**/_._").DeleteFiles(); + + var latestFramework = frameworkList.Last(); + var olderFrameworks = frameworkList.TakeUntil(older => older == latestFramework).ToList(); + + // Move common files to base directory + (baseDirectory / latestFramework).GlobFiles("*.*") + .Where(file => olderFrameworks.All(older => + File.Exists(baseDirectory / older / file.Name) && + FilesAreEqual(file, baseDirectory / older / file.Name))) + .ForEach(file => + { + Log.Debug("Move Common File To Base Directory: \"{0}\"", baseDirectory / file.Name); + file.MoveToDirectory(baseDirectory, ExistsPolicy.FileOverwrite); + olderFrameworks.ForEach(older => (baseDirectory / older / file.Name).DeleteFile()); + }); + + // Create link files for duplicates + frameworkList.Skip(1).Reverse() + .ForEach(current => (baseDirectory / current).GlobFiles("*.dll") + .ForEach(file => { - foreach (var olderFramework in TargetFramework.NetFramework.TakeUntil(older => - older == currentFramework)) + var linkTarget = frameworkList.TakeUntil(older => older == current) + .FirstOrDefault(older => File.Exists(baseDirectory / older / file.Name) && + FilesAreEqual(file, baseDirectory / older / file.Name)); + + if (linkTarget != null) { - var duplicateCandidate = TracerHomeDirectory / "netfx" / olderFramework / file.Name; - if (File.Exists(duplicateCandidate) && FilesAreEqual(file, duplicateCandidate)) - { - file.DeleteFile(); - (TracerHomeDirectory / "netfx" / currentFramework / (file.Name + ".link")).WriteAllText( - olderFramework, Encoding.ASCII, false); - break; - } + Log.Debug("Generate Link File \"{0}\" To: {1}", file + ".link", linkTarget); + file.DeleteFile(); + (baseDirectory / current / (file.Name + ".link")).WriteAllText(linkTarget, Encoding.ASCII, false); } - } - ); - } + })); - // Create placeholder file for empty directories - foreach (var currentFramework in TargetFramework.NetFramework) - { - if ((TracerHomeDirectory / "netfx" / currentFramework).GlobFiles("*.*").Count == 0) - { - (TracerHomeDirectory / "netfx" / currentFramework / "_._") - .WriteAllText(string.Empty, Encoding.ASCII, false); - } - } + // Create placeholder files for empty directories + frameworkList.Where(fw => (baseDirectory / fw).GlobFiles("*.*").Count == 0) + .ForEach(fw => (baseDirectory / fw / "_._").WriteAllText(string.Empty, Encoding.ASCII, false)); } } + Target GenerateAssemblyRedirectionSource => _ => _ + .Unlisted() + .After(PublishManagedProfiler) + .Executes(() => + { + if (IsWin) + { + // Generate .NET Framework redirects + // .NET Framework version normalization: + // net462 -> 462, net47 -> 470, net471 -> 471, net472 -> 472 + // Frameworks with only 2 digits (e.g., 47) are padded with 0 (470) + AssemblyRedirectionSourceGenerator.Generate( + TracerHomeDirectory / TargetFramework.OutputFolderNetFramework, + SourceDirectory / Projects.AutoInstrumentationNative / $"assembly_redirection_{TargetFramework.OutputFolderNetFramework}.h", + new Regex(@"^net(?\d)(?\d)(?\d)?$"), + groups => groups["patch"].Success + ? groups["major"].Value + groups["minor"].Value + groups["patch"].Value + : groups["major"].Value + groups["minor"].Value + "0"); + } + + // Generate .NET (Core) redirects + // .NET Core version normalization: + // net8.0 -> 80, net9.0 -> 90, net10.0 -> 100 + AssemblyRedirectionSourceGenerator.Generate( + TracerHomeDirectory / TargetFramework.OutputFolderNet, + SourceDirectory / Projects.AutoInstrumentationNative / $"assembly_redirection_{TargetFramework.OutputFolderNet}.h", + new Regex(@"^net(?\d{1,2})\.(?\d)$"), + groups => groups["major"].Value + groups["minor"].Value); + }); + Target PublishNativeProfiler => _ => _ .Unlisted() .DependsOn(PublishNativeProfilerWindows) @@ -654,75 +647,6 @@ bool FilesAreEqual(string filePath1, string filePath2) } }); - Target CopyAdditionalDeps => _ => _ - .Unlisted() - .Description("Creates AutoInstrumentation.AdditionalDeps and shared store in tracer-home") - .After(CompileManagedSrc) - .Executes(() => - { - if (AdditionalDepsDirectory.DirectoryExists()) - { - Directory.Delete(AdditionalDepsDirectory, true); - } - - if (StoreDirectory.DirectoryExists()) - { - Directory.Delete(StoreDirectory, true); - } - - DotNetPublish(s => s - .SetProject(Solution.GetProjectByName(Projects.AutoInstrumentationAdditionalDeps)) - .SetConfiguration(BuildConfiguration) - .SetTargetPlatformAnyCPU() - .SetProperty("NukePlatform", Platform) - .SetProperty("TracerHomePath", TracerHomeDirectory) - .EnableNoBuild() - .SetNoRestore(NoRestore) - .CombineWith(TestFrameworks.ExceptNetFramework(), (p, framework) => p - .SetFramework(framework) - // Additional-deps probes the directory using SemVer format. - // Example: For net8.0, additional-deps uses 8.0.0. - // Major and Minor version are extracted from framework and default value of 0 is appended for patch. - .SetOutput(AdditionalDepsDirectory / "shared" / "Microsoft.NETCore.App" / framework.ToString().Substring("net".Length) + ".0"))); - - AdditionalDepsDirectory.GlobFiles("**/*deps.json") - .ForEach(file => - { - var rawJson = File.ReadAllText(file); - var depsJson = JsonNode.Parse(rawJson).AsObject(); - - var folderRuntimeName = depsJson.GetFolderRuntimeName(); - var architectureStores = new List() - .AddIf(StoreDirectory / "x64" / folderRuntimeName, RuntimeInformation.OSArchitecture == Architecture.X64) - .AddIf(StoreDirectory / "x86" / folderRuntimeName, IsWin) // Only Windows supports x86 runtime - .AddIf(StoreDirectory / "arm64" / folderRuntimeName, IsArm64) - .AsReadOnly(); - - depsJson.CopyNativeDependenciesToStore(file, architectureStores); - depsJson.RemoveDuplicatedLibraries(architectureStores); - depsJson.RemoveOpenTelemetryLibraries(); - - // To allow roll forward for applications, like Roslyn, that target one tfm - // but have a later runtime move the libraries under the original tfm folder - // to the latest one. - if (folderRuntimeName == TargetFramework.NET8_0 || folderRuntimeName == TargetFramework.NET9_0 || folderRuntimeName == TargetFramework.NET10_0) - { - depsJson.RollFrameworkForward(TargetFramework.NET8_0, TargetFramework.NET10_0, architectureStores); - depsJson.RollFrameworkForward(TargetFramework.NET9_0, TargetFramework.NET10_0, architectureStores); - } - - // Write the updated deps.json file. - File.WriteAllText(file, depsJson.ToJsonString(new() - { - WriteIndented = true - })); - }); - - // Cleanup Additional Deps Directory - AdditionalDepsDirectory.GlobFiles("**/*.dll", "**/*.pdb", "**/*.xml", "**/*.dylib", "**/*.so").ForEach(file => file.DeleteFile()); - AdditionalDepsDirectory.GlobDirectories("**/runtimes").ForEach(directory => directory.DeleteDirectory()); - }); - Target PublishRuleEngineJson => _ => _ .After(PublishManagedProfiler) .Description("Publishes a file with assembly name and version for rule engine validation.") @@ -837,16 +761,6 @@ private void RunBootstrappingTests() } } - private string MapToFolderOutput(TargetFramework targetFramework) - { - return targetFramework.ToString().StartsWith("net4") ? "netfx" : "net"; - } - - private string MapToFolderOutputNetFx(TargetFramework targetFramework) - { - return $"netfx/{targetFramework}"; - } - private void RestoreLegacyNuGetPackagesConfig(IEnumerable legacyRestoreProjects) { foreach (var project in legacyRestoreProjects) diff --git a/build/Build.cs b/build/Build.cs index 3584eed0a4..417c49e0b6 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -105,11 +105,11 @@ void DeleteReparsePoints(string path) .After(Restore) .DependsOn(CreateRequiredDirectories) .DependsOn(BuildInstallationScripts) - .DependsOn(GenerateNetFxTransientDependencies) + .DependsOn(GenerateTransientDependencies) .DependsOn(CompileManagedSrc) .DependsOn(PublishManagedProfiler) .DependsOn(PublishRuleEngineJson) - .DependsOn(GenerateNetFxAssemblyRedirectionSource) + .DependsOn(GenerateAssemblyRedirectionSource) .DependsOn(CompileNativeSrc) .DependsOn(PublishNativeProfiler) .DependsOn(CopyInstrumentScripts) diff --git a/build/Extensions/DepsJsonExtensions.cs b/build/Extensions/DepsJsonExtensions.cs deleted file mode 100644 index 6465d9ffab..0000000000 --- a/build/Extensions/DepsJsonExtensions.cs +++ /dev/null @@ -1,150 +0,0 @@ -using System.Collections.ObjectModel; -using System.Text.Json.Nodes; -using Nuke.Common.IO; - -namespace Extensions; - -internal static class DepsJsonExtensions -{ - public static string GetFolderRuntimeName(this JsonObject depsJson) - { - var runtimeName = depsJson["runtimeTarget"]["name"].GetValue(); - var folderRuntimeName = runtimeName switch - { - ".NETCoreApp,Version=v8.0" => "net8.0", - ".NETCoreApp,Version=v9.0" => "net9.0", - ".NETCoreApp,Version=v10.0" => "net10.0", - _ => throw new ArgumentOutOfRangeException(nameof(runtimeName), runtimeName, - "This value is not supported. You have probably introduced new .NET version to AutoInstrumentation") - }; - - return folderRuntimeName; - } - - public static void CopyNativeDependenciesToStore(this JsonObject depsJson, AbsolutePath file, IReadOnlyList architectureStores) - { - var depsDirectory = file.Parent; - - foreach (var targetProperty in depsJson["targets"].AsObject()) - { - var target = targetProperty.Value.AsObject(); - - foreach (var packages in target) - { - if (!packages.Value.AsObject().TryGetPropertyValue("runtimeTargets", out var runtimeTargets)) - { - continue; - } - - foreach (var runtimeDependency in runtimeTargets.AsObject()) - { - var sourceFileName = Path.Combine(depsDirectory, runtimeDependency.Key); - - foreach (var architectureStore in architectureStores) - { - var targetFileName = Path.Combine(architectureStore, packages.Key.ToLowerInvariant(), runtimeDependency.Key); - var targetDirectory = Path.GetDirectoryName(targetFileName); - Directory.CreateDirectory(targetDirectory); - File.Copy(sourceFileName, targetFileName); - } - } - } - } - } - - public static void RemoveOpenTelemetryLibraries(this JsonObject depsJson) - { - var dependencies = depsJson.GetDependencies(); - var runtimeLibraries = depsJson["libraries"].AsObject(); - var keysToRemove = dependencies - .Where(x => x.Key.StartsWith("OpenTelemetry")) - .Select(x => x.Key) - .ToList(); - - foreach (var key in keysToRemove) - { - dependencies.Remove(key); - runtimeLibraries.Remove(key); - } - } - - public static void RollFrameworkForward(this JsonObject depsJson, string runtime, string rollForwardRuntime, IReadOnlyList architectureStores) - { - // Update the contents of the json file. - foreach (var dep in depsJson.GetDependencies()) - { - var depObject = dep.Value.AsObject(); - if (depObject.TryGetPropertyValue("runtime", out var runtimeNode)) - { - var runtimeObject = runtimeNode.AsObject(); - var libKeys = runtimeObject - .Select(x => x.Key) - .Where(x => x.StartsWith($"lib/{runtime}")) - .ToList(); - - foreach (var libKey in libKeys) - { - var libNode = runtimeObject[libKey]; - var newKey = libKey.Replace($"lib/{runtime}", $"lib/{rollForwardRuntime}"); - - runtimeObject.Remove(libKey); - runtimeObject.Add(newKey, libNode); - } - } - } - - // Roll forward each architecture by renaming the tfm folder holding the assemblies. - foreach (var architectureStore in architectureStores) - { - var assemblyDirectories = architectureStore.GetDirectories(); - foreach (var assemblyDirectory in assemblyDirectories) - { - var assemblyVersionDirectories = assemblyDirectory.GetDirectories().ToList(); - if (assemblyVersionDirectories.Count != 1) - { - throw new InvalidOperationException( - $"Expected exactly one directory under {assemblyDirectory} but found {assemblyVersionDirectories.Count} instead."); - } - - var assemblyVersionDirectory = assemblyVersionDirectories[0]; - var sourceDir = assemblyVersionDirectory / "lib" / runtime; - if (sourceDir.Exists()) - { - var destDir = assemblyVersionDirectory / "lib" / rollForwardRuntime; - - sourceDir.Copy(destDir); - - // Since the json was also rolled forward the original tfm folder can be deleted. - sourceDir.DeleteDirectory(); - } - } - } - } - - public static void RemoveDuplicatedLibraries(this JsonObject depsJson, ReadOnlyCollection architectureStores) - { - var duplicatedLibraries = new List<(string Name, string Version)> { ("Microsoft.Extensions.Configuration.Binder", "8.0.0") }; - - foreach (var duplicatedLibrary in duplicatedLibraries) - { - if ((depsJson["libraries"] as JsonObject)!.ContainsKey(duplicatedLibrary.Name + "/" + duplicatedLibrary.Version)) - { - throw new NotSupportedException($"Cannot remove {duplicatedLibrary.Name.ToLower()}/{duplicatedLibrary.Version} folder. It is referenced in json file"); - } - foreach (var architectureStore in architectureStores) - { - var directoryToBeRemoved = architectureStore / duplicatedLibrary.Name.ToLower() / duplicatedLibrary.Version; - if (!Directory.Exists(directoryToBeRemoved)) - { - throw new NotSupportedException($"Directory {directoryToBeRemoved} does not exists. Verify it."); - } - Directory.Delete(directoryToBeRemoved, true); - } - } - } - - private static JsonObject GetDependencies(this JsonObject depsJson) - { - return depsJson["targets"].AsObject().First().Value.AsObject(); - } -} diff --git a/build/Extensions/ListExtensions.cs b/build/Extensions/ListExtensions.cs deleted file mode 100644 index 7ff9bccf0d..0000000000 --- a/build/Extensions/ListExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Extensions; - -public static class ListExtensions -{ - public static List AddIf(this List list, T item, bool condition) - { - if (condition) - { - list.Add(item); - } - - return list; - } -} diff --git a/build/Projects.cs b/build/Projects.cs index 46b224d841..258ff621bf 100644 --- a/build/Projects.cs +++ b/build/Projects.cs @@ -1,11 +1,10 @@ public static class Projects { public const string AutoInstrumentation = "OpenTelemetry.AutoInstrumentation"; - public const string AutoInstrumentationNetFxAssemblies = "OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework"; + public const string AutoInstrumentationAssemblies = "OpenTelemetry.AutoInstrumentation.Assemblies"; public const string AutoInstrumentationLoader = "OpenTelemetry.AutoInstrumentation.Loader"; public const string AutoInstrumentationNative = "OpenTelemetry.AutoInstrumentation.Native"; public const string AutoInstrumentationStartupHook = "OpenTelemetry.AutoInstrumentation.StartupHook"; - public const string AutoInstrumentationAdditionalDeps = "OpenTelemetry.AutoInstrumentation.AdditionalDeps"; public const string AutoInstrumentationAspNetCoreBootstrapper = "OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper"; public static class Mocks diff --git a/build/TargetFramework.cs b/build/TargetFramework.cs index b6e1208594..71bce8e715 100644 --- a/build/TargetFramework.cs +++ b/build/TargetFramework.cs @@ -7,20 +7,41 @@ [TypeConverter(typeof(TargetFrameworkTypeConverter))] public class TargetFramework : Enumeration { - public static readonly TargetFramework NOT_SPECIFIED = new() { Value = string.Empty }; - public static readonly TargetFramework NET462 = new() { Value = "net462" }; - public static readonly TargetFramework NET47 = new() { Value = "net47" }; - public static readonly TargetFramework NET471 = new() { Value = "net471" }; - public static readonly TargetFramework NET472 = new() { Value = "net472" }; - public static readonly TargetFramework NETCore3_1 = new() { Value = "netcoreapp3.1" }; - public static readonly TargetFramework NET8_0 = new() { Value = "net8.0" }; - public static readonly TargetFramework NET9_0 = new() { Value = "net9.0" }; - public static readonly TargetFramework NET10_0 = new() { Value = "net10.0" }; + public const string OutputFolderNet = "net"; + public const string OutputFolderNetFramework = "netfx"; + + private TargetFramework(string value) + { + Value = value; + OutputFolder = value switch + { + _ when value.StartsWith("net") && value.Contains('.') => OutputFolderNet, + // with the right order this check can be simplieid to just check for "net" prefix, but keep it explicit for clarity + _ when value.StartsWith("net") && !value.Contains('.') => OutputFolderNetFramework, + _ => string.Empty + }; + } + + public static readonly TargetFramework NOT_SPECIFIED = new(string.Empty); + public static readonly TargetFramework NET462 = new("net462"); + public static readonly TargetFramework NET47 = new("net47"); + public static readonly TargetFramework NET471 = new("net471"); + public static readonly TargetFramework NET472 = new("net472"); + public static readonly TargetFramework NET8_0 = new("net8.0"); + public static readonly TargetFramework NET9_0 = new("net9.0"); + public static readonly TargetFramework NET10_0 = new("net10.0"); + + public string OutputFolder { get; private init; } // should be in version order - public static readonly TargetFramework[] NetFramework = { + public static readonly TargetFramework[] NetFramework = [ NET462, NET47, NET471, NET472 - }; + ]; + + // should be in version order + public static readonly TargetFramework[] Net = [ + NET8_0, NET9_0, NET10_0 + ]; public static implicit operator string(TargetFramework framework) { diff --git a/build/TransientDependenciesGenerator.cs b/build/TransientDependenciesGenerator.cs index 8c04d17cb3..b99ffa62c8 100644 --- a/build/TransientDependenciesGenerator.cs +++ b/build/TransientDependenciesGenerator.cs @@ -5,15 +5,19 @@ internal static class TransientDependenciesGenerator { - private static string GetLabel(string framework) => - framework != null - ? $"Transient dependencies auto-generated by {nameof(TransientDependenciesGenerator)} for {framework}" + private const string NetFrameworkFamilyLabel = "all .NET Framework"; + private const string NetCoreFamilyLabel = "all .NET (Core)"; + private const string NetFrameworkCondition = " '$(TargetFrameworkIdentifier)' == '.NETFramework' "; + private const string NetCoreCondition = " '$(TargetFrameworkIdentifier)' == '.NETCoreApp' "; + + private static string GetLabel(string frameworkOrFamily) => + frameworkOrFamily != null + ? $"Transient dependencies auto-generated by {nameof(TransientDependenciesGenerator)} for {frameworkOrFamily}" : $"Transient dependencies auto-generated by {nameof(TransientDependenciesGenerator)}"; private static (string PackageName, string PackageVersion) GetPackageProperties(ProjectElement item) => item is ProjectItemElement { ElementName: "PackageVersion" } pkgRef - ? (pkgRef.Include, - pkgRef.Metadata.FirstOrDefault(it => it.Name == "Version")?.Value) + ? (pkgRef.Include, pkgRef.Metadata.FirstOrDefault(it => it.Name == "Version")?.Value) : (null, null); private static void AddPackageReference(ProjectItemGroupElement items, string packageName, string packageVersion) @@ -22,10 +26,39 @@ private static void AddPackageReference(ProjectItemGroupElement items, string pa reference.AddMetadata("Version", packageVersion, expressAsAttribute: true); } - private static void CleanUnusedDependencies(string framework, Dictionary deps, Microsoft.Build.Evaluation.Project packagesProject) + private static ProjectItemGroupElement GetOrCreateItemGroup( + Microsoft.Build.Evaluation.Project packagesProject, + string label, + string condition = null) { - var label = GetLabel(framework); - var versionGroup = packagesProject.Xml.ItemGroups.First(x => x.Label == label); + var group = packagesProject.Xml.ItemGroups.FirstOrDefault(x => x.Label == label); + if (group == null) + { + group = packagesProject.Xml.AddItemGroup(); + group.Label = label; + if (condition != null) + { + group.Condition = condition; + } + } + return group; + } + + private static void CleanUnusedDependencies( + string label, + IEnumerable validDependencies, + Microsoft.Build.Evaluation.Project packagesProject) + { + var versionGroup = packagesProject.Xml.ItemGroups.FirstOrDefault(x => x.Label == label); + + if (versionGroup == null) + { + return; + } + + var validDepsSet = validDependencies + .Select(d => (d.Name, d.Version)) + .ToHashSet(); foreach (var pkg in versionGroup.Children.ToArray()) { @@ -35,21 +68,59 @@ private static void CleanUnusedDependencies(string framework, Dictionary kvp.Value) : deps[framework]) - .Any(item => item.Name == pkgProp.PackageName && item.Version == pkgProp.PackageVersion); - - if (!dependencyExists) + if (!validDepsSet.Contains((pkgProp.PackageName, pkgProp.PackageVersion))) { versionGroup.RemoveChild(pkg); } } } + private static void MoveCommonDependenciesToGroup( + Microsoft.Build.Evaluation.Project packagesProject, + IReadOnlyCollection targetFrameworks, + string groupLabel, + string groupCondition = null) + { + if (targetFrameworks.Count == 0) + { + return; + } + + var targetGroup = GetOrCreateItemGroup(packagesProject, groupLabel, groupCondition); + var frameworkGroups = targetFrameworks + .Select(fw => packagesProject.Xml.ItemGroups.First(x => x.Label == GetLabel(fw))) + .ToList(); + + var candidatePackages = frameworkGroups[0].Children + .Select(GetPackageProperties) + .Where(pkg => pkg.PackageName != null && pkg.PackageVersion != null) + .ToArray(); + + foreach (var pkg in candidatePackages) + { + var existsInAllFrameworks = frameworkGroups + .All(group => group.Children.OfType() + .Any(it => GetPackageProperties(it) == pkg)); + + if (existsInAllFrameworks) + { + foreach (var group in frameworkGroups) + { + var reference = group.Children.OfType() + .First(it => GetPackageProperties(it) == pkg); + group.RemoveChild(reference); + } + + AddPackageReference(targetGroup, pkg.PackageName, pkg.PackageVersion); + } + } + } + public static void Run(Project targetProject) { var project = targetProject.GetMSBuildProject(); var deps = Generator.EnumerateDependencies(project.FullPath); - var packages = targetProject.Solution.Directory / "src" / Projects.AutoInstrumentationNetFxAssemblies / + var packages = targetProject.Solution.Directory / "src" / Projects.AutoInstrumentationAssemblies / "Directory.Packages.props"; var packagesProject = ProjectModelTasks.ParseProject(packages); @@ -62,82 +133,85 @@ public static void Run(Project targetProject) return; } - // generate new transitive dependencies + // Generate new transitive dependencies for each framework foreach (var framework in projectFrameworks) { var label = GetLabel(framework); - var projectForTfm = targetProject.GetMSBuildProject(targetFramework: framework); var definedVersions = projectForTfm - .Items.Where(it => it.ItemType == "PackageVersion").ToDictionary(item => item.EvaluatedInclude, - item => item.GetMetadata("Version")); + .Items.Where(it => it.ItemType == "PackageVersion") + .ToDictionary(item => item.EvaluatedInclude, item => item.GetMetadata("Version")); - var versionGroup = packagesProject.Xml.ItemGroups.FirstOrDefault(x => x.Label == label); - if (versionGroup == null) - { - versionGroup = packagesProject.Xml.AddItemGroup(); - versionGroup.Label = label; - versionGroup.Condition = $" '$(TargetFramework)' == '{framework}' "; - } + var versionGroup = GetOrCreateItemGroup(packagesProject, label, $" '$(TargetFramework)' == '{framework}' "); - foreach (var item in deps[framework]) + if (deps.TryGetValue(framework, out var frameworkDeps)) { - if (!definedVersions.ContainsKey(item.Name)) + foreach (var item in frameworkDeps) { - AddPackageReference(versionGroup, item.Name, item.Version); + if (!definedVersions.ContainsKey(item.Name)) + { + AddPackageReference(versionGroup, item.Name, item.Version); + } } } } - // group dependencies - { - var commonLabel = GetLabel(null); - var commonGroup = packagesProject.Xml.ItemGroups.FirstOrDefault(x => x.Label == commonLabel); - if (commonGroup == null) - { - commonGroup = packagesProject.Xml.AddItemGroup(); - commonGroup.Label = commonLabel; - } + // Group frameworks by family + var netFrameworkTargets = projectFrameworks + .Where(target => TargetFramework.NetFramework.Any(it => it == target)) + .ToList(); + var netCoreTargets = projectFrameworks + .Where(target => TargetFramework.Net.Any(it => it == target)) + .ToList(); - var someFramework = projectFrameworks.First(); - var allFrameworkGroups = targetProject.GetTargetFrameworks()!.Select(GetLabel) - .Select(label => packagesProject.Xml.ItemGroups.First(x => x.Label == label)).ToArray(); + // Optimize dependencies in hierarchical order (general to specific): + // 1. Common across ALL frameworks + // 2. Common within .NET Framework family + // 3. Common within .NET (Core) family + // 4. Framework-specific (already in individual groups) - var label = GetLabel(someFramework); - var versionGroup = packagesProject.Xml.ItemGroups.First(x => x.Label == label); + MoveCommonDependenciesToGroup(packagesProject, projectFrameworks, GetLabel(null)); - var packageVersionsToProcess = versionGroup.Children - .Select(GetPackageProperties) - .Where(pkg => pkg.PackageName != null && pkg.PackageVersion != null) - .ToArray(); - - foreach (var pkg in packageVersionsToProcess) - { - var existsInAllFrameworks = allFrameworkGroups - .All(group => group.Children.OfType() - .Any(it => GetPackageProperties(it) == pkg)); + if (netFrameworkTargets.Count > 1) + { + MoveCommonDependenciesToGroup( + packagesProject, + netFrameworkTargets, + GetLabel(NetFrameworkFamilyLabel), + NetFrameworkCondition); + } - if (existsInAllFrameworks) - { - foreach (var group in allFrameworkGroups) - { - var reference = group.Children.OfType() - .First(it => GetPackageProperties(it) == pkg); - group.RemoveChild(reference); - } + if (netCoreTargets.Count > 1) + { + MoveCommonDependenciesToGroup( + packagesProject, + netCoreTargets, + GetLabel(NetCoreFamilyLabel), + NetCoreCondition); + } - AddPackageReference(commonGroup, pkg.PackageName, pkg.PackageVersion); - } + // Clean up unused dependencies from all groups + foreach (var framework in projectFrameworks) + { + if (deps.TryGetValue(framework, out var frameworkDeps)) + { + CleanUnusedDependencies(GetLabel(framework), frameworkDeps, packagesProject); } } - // clean unused dependencies - foreach (var framework in targetProject.GetTargetFrameworks() ?? []) + CleanUnusedDependencies(GetLabel(null), deps.Values.SelectMany(d => d), packagesProject); + + if (netFrameworkTargets.Count > 0) { - CleanUnusedDependencies(framework, deps, packagesProject); + var netFrameworkDeps = netFrameworkTargets.SelectMany(it => deps.TryGetValue(it, out var value) ? value : []); + CleanUnusedDependencies(GetLabel(NetFrameworkFamilyLabel), netFrameworkDeps, packagesProject); } - CleanUnusedDependencies(null, deps, packagesProject); + if (netCoreTargets.Count > 0) + { + var netCoreDeps = netCoreTargets.SelectMany(it => deps.TryGetValue(it, out var value) ? value : []); + CleanUnusedDependencies(GetLabel(NetCoreFamilyLabel), netCoreDeps, packagesProject); + } packagesProject.Save(); } diff --git a/docs/README.md b/docs/README.md index c908d47166..ec546ff5ff 100644 --- a/docs/README.md +++ b/docs/README.md @@ -58,9 +58,10 @@ OpenTelemetry .NET Automatic Instrumentation is built on top of - `System.Diagnostics.DiagnosticSource`: [`10.0.0`](https://www.nuget.org/packages/System.Diagnostics.DiagnosticSource/10.0.0) referencing `System.Runtime.CompilerServices.Unsafe`: [`6.1.2`](https://www.nuget.org/packages/System.Runtime.CompilerServices.Unsafe/6.1.2) -You can find all references in -[OpenTelemetry.AutoInstrumentation.csproj](../src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj) -and [OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Build.props](../src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Build.props). +You can find all references here: + +- [OpenTelemetry.AutoInstrumentation.csproj](../src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj) +- [OpenTelemetry.AutoInstrumentation.Assemblies/Directory.Packages.props](../src/OpenTelemetry.AutoInstrumentation.Assemblies/Directory.Packages.props) To automatically instrument applications, the OpenTelemetry .NET Automatic Instrumentation does the following: @@ -165,8 +166,6 @@ When running your application, make sure to: | `CORECLR_PROFILER_PATH` | .NET on macOS | `$INSTALL_DIR/osx-arm64/OpenTelemetry.AutoInstrumentation.Native.dylib` | | `CORECLR_PROFILER_PATH_32` | .NET on Windows | `$INSTALL_DIR/win-x86/OpenTelemetry.AutoInstrumentation.Native.dll` | | `CORECLR_PROFILER_PATH_64` | .NET on Windows | `$INSTALL_DIR/win-x64/OpenTelemetry.AutoInstrumentation.Native.dll` | -| `DOTNET_ADDITIONAL_DEPS` | .NET | `$INSTALL_DIR/AdditionalDeps` | -| `DOTNET_SHARED_STORE` | .NET | `$INSTALL_DIR/store` | | `DOTNET_STARTUP_HOOKS` | .NET | `$INSTALL_DIR/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll` | | `OTEL_DOTNET_AUTO_HOME` | All versions | `$INSTALL_DIR` | diff --git a/docs/assembly-conflict-resolution.md b/docs/assembly-conflict-resolution.md new file mode 100644 index 0000000000..f927b78a33 --- /dev/null +++ b/docs/assembly-conflict-resolution.md @@ -0,0 +1,291 @@ +# Assembly Conflict Resolution + +OpenTelemetry .NET Automatic Instrumentation ships its own dependencies +(for example, `OpenTelemetry.dll`, `System.Diagnostics.DiagnosticSource.dll`). +When an instrumented application has the same dependencies at different +versions, a conflict can arise. This document explains how the +instrumentation resolves such conflicts, what the runtime mechanics behind +this are, and what limitations to be aware of. + +## How .NET resolves assemblies + +Understanding the runtime's assembly-loading pipeline is essential to +understanding why the instrumentation does what it does. + +### .NET + +On .NET (Core), the assembly-loading subsystem is built around +`AssemblyLoadContext` (ALC). There are two important concepts: + +| Concept | Description | +| --- | --- | +| **Default ALC** | The main context that the runtime creates to load application. All application assemblies listed in the Trusted Platform Assemblies (TPA) list are loaded here automatically. | +| **Custom ALC** | A user-created context that can load assemblies independently, providing isolation from the Default ALC. | + +#### Assembly binding + +Assembly binding happens **once per `AssemblyRef`**: once a reference is +bound to a concrete assembly, the result is cached and no resolution +callbacks fire for that reference again. + +#### Resolution order + +When code triggers an assembly reference, the runtime first checks +whether the assembly is **already loaded** in the current ALC at the +requested version or higher. If a match is found, that instance is +used immediately and no further steps run. If an assembly is missing +or a same-named assembly is loaded but at a lower version, the match +fails and resolution continues. + +Next, the runtime invokes the current ALC's **`Load()` method**. For the +Default ALC this performs a TPA list lookup. For a custom ALC this calls +the user-provided override. If `Load()` returns an assembly, resolution +stops. + +If the current ALC is a custom context and `Load()` returned `null`, the +runtime **falls back to the Default ALC** and checks the TPA list. + +If the assembly is still not found, the following events fire in order: + +1. **`AssemblyLoadContext.Default.Resolving`** +2. **Custom ALC `Resolving`** (skipped when the current context is the + Default ALC) +3. **`AppDomain.CurrentDomain.AssemblyResolve`** + +This order is important for the assembly conflict resolution strategies: +the custom ALC's `Load()` method provides the earliest opportunity to supply an +assembly when loading to a custom context, while `Default.Resolving` is the +earliest event-based callback for the Default ALC. Note that +`AppDomain.CurrentDomain.AssemblyResolve` also receives a built-in handler that +automatically resolves co-located dependencies from the same directory — so +subscribing to it may not always be reliable. + +#### Key property: type isolation + +The same assembly loaded into two different ALCs produces **distinct +types**. This means that data shared through static fields (for example, +`System.Diagnostics.Activity.Current`) must come from a single assembly +instance — otherwise different parts of the application will see +different state. + +#### Loading restrictions + +- If an ALC already contains a same-named assembly at a lower version, + attempting to load a higher version into the same ALC will fail. +- For the Default ALC, if the TPA list contains a lower version of an + assembly, loading a higher version will fail. Conversely, if the TPA + list contains a higher version and a lower version is requested, the + TPA's higher version is silently used instead. + +### .NET Framework + +On .NET Framework there is no `AssemblyLoadContext`. Assembly loading +is scoped to the `AppDomain`. When the runtime cannot resolve an assembly +the `AppDomain.CurrentDomain.AssemblyResolve` event fires, and handlers +can supply the assembly via `Assembly.LoadFrom`. + +## The problem + +The instrumentation may depend on a **higher version** of a shared library +than the version the application was built against. For example: + +- The application references `System.Diagnostics.DiagnosticSource` 8.0.0 +- The instrumentation requires `System.Diagnostics.DiagnosticSource` 10.0.0 + +If the lower version loads first, the instrumentation may not work +correctly because it relies on APIs that only exist in the higher +version. Conversely, if the instrumentation's higher version loads, it is +usually backward-compatible and both the application and the +instrumentation work correctly. + +The goal is to **ensure the highest version wins** while keeping both +the application and the instrumentation using the **same assembly +instance** to avoid shared-state drift. + +## Resolution strategies by deployment mode + +### 1. NuGet package deployment (.NET and .NET Framework) + +When the instrumentation is added as a NuGet package, the .NET SDK +resolves assembly versions at **build time**. The standard NuGet +version-unification rules guarantee that the highest referenced version +of each dependency is selected for the output. No special runtime +conflict resolution is needed in this case. + +### 2. Native profiler deployment (.NET and .NET Framework) + +When deployed via the native profiler, the instrumentation does not +participate in the build. It is injected into the application at runtime. + +#### IL rewriting of assembly references + +As each module loads, the native profiler inspects every assembly +reference (`AssemblyRef`) in the module's metadata. If the +instrumentation ships a higher version of that assembly, the profiler +rewrites the reference in-place to point to the higher version. This is +controlled by a version map compiled into the native profiler (see +[`assembly_redirection_net.h`](../src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_net.h) +and +[`assembly_redirection_netfx.h`](../src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_netfx.h)). + +After rewriting, the runtime proceeds to resolve the rewritten +reference. Because the version now matches what the instrumentation +ships, the resolution follows the pipeline described above. + +#### Managed assembly resolver (.NET) + +On .NET, the instrumentation subscribes to +`AssemblyLoadContext.Default.Resolving` — the earliest event-based callback in the +[resolution order](#resolution-order) — to reliably supply an assembly before +any other handler runs. Because assembly references have already +been rewritten by the native profiler, this event fires in two situations: + +| Situation | Why it fires | Where we load the assembly | +| --- | --- | --- | +| Assembly is **not** in the TPA list (for example, `OpenTelemetry.dll`) | The runtime has no default location for it | **Default ALC** — no conflict risk | +| Assembly **is** in the TPA list but with a **lower** version | The profiler rewrote the reference to a higher version that the TPA cannot satisfy | **Custom ALC** — loading into the Default ALC would fail because the TPA already provides a lower version | + +When a TPA-conflicting assembly is loaded into a custom ALC it is +isolated from the Default ALC version. + +Note, that if the TPA already has the same or a higher version, the runtime satisfies +the reference automatically and the event never fires — no action is needed. + +#### Managed assembly resolver (.NET Framework) + +On .NET Framework, the instrumentation subscribes to +`AppDomain.CurrentDomain.AssemblyResolve` and loads the required +assemblies from the instrumentation's home directory using +`Assembly.LoadFrom`. + +### 3. StartupHook-only deployment (.NET only) + +When the native profiler is not attached, the instrumentation relies +solely on the .NET [startup hook](https://github.com/dotnet/runtime/blob/main/docs/design/features/host-startup-hook.md). +Without the native profiler there is no IL rewriting, and without a +NuGet package there is no build-time version resolution. + +In this mode the runtime loads the customer application and its +dependencies into the Default ALC automatically. Once they are there, +the instrumentation cannot replace them with higher versions. + +**Solution — application isolation:** The startup hook creates an +isolated ALC and: + +1. Loads the customer's entry assembly into the isolated ALC. +2. Adjusts the runtime environment so that framework APIs (such as + `Assembly.Load` and `Assembly.GetEntryAssembly`) resolve correctly + within the isolated context. +3. Initializes the instrumentation inside the same isolated ALC. +4. For every dependency requested by either the application or the + instrumentation, the isolated ALC's `Load` method compares the + version available in the TPA list against the version shipped by + the instrumentation and **picks the higher one**. +5. Invokes the customer's `Main` entry point via reflection, then calls + `Environment.Exit` to prevent the runtime from re-executing the + application in the Default ALC. + +If setup fails, the isolation is reverted and the runtime falls back to +executing the application normally (unless fail-fast mode is enabled via +`OTEL_DOTNET_AUTO_FAIL_FAST`). + +## Known limitations + +The resolution strategies described above cover the majority of cases, +but there are scenarios where they cannot fully control assembly loading. + +### Explicit loading into the Default ALC + +If application code explicitly calls +`AssemblyLoadContext.Default.LoadFromAssemblyPath` (or +`Assembly.LoadFrom`, which loads into the Default ALC) for an assembly +that the instrumentation also depends on, the instrumentation cannot +prevent or override that load. + +- **Native profiler deployment:** This is less of a problem in practice. + Because the profiler has already rewritten all `AssemblyRef` entries to + point to the instrumentation's versions, the explicitly loaded assembly + will typically not be referenced by any rewritten code. There is no + shared-state drift, but the unused assembly remains loaded in memory. +- **StartupHook-only deployment:** This is more impactful. The + application and instrumentation run inside the isolated ALC, but an + explicit load into the Default ALC creates a second copy of the + assembly. Code that crosses the ALC boundary may encounter type + mismatches or shared-state drift (for example, + `System.Diagnostics.Activity.Current` seen from two different + `DiagnosticSource` instances). + +### StartupHook-only: the customer application is loaded twice + +In isolated mode the startup hook loads the customer's entry assembly +into the isolated ALC. However, the .NET runtime +has already loaded the same entry assembly into the Default ALC before +the startup hook runs. This means the entry assembly exists in both +contexts. The startup hook calls `Environment.Exit` after the isolated +execution completes to prevent the runtime from executing the Default-ALC +copy, but the duplicate load itself is unavoidable. + +### StartupHook-only: inevitable assembly leakage to the Default ALC + +The startup hook runs after the .NET host has already initialized. Any +assemblies loaded before the hook — including the startup hook assembly +itself, its direct dependencies, and any other `DOTNET_STARTUP_HOOKS` +that appear earlier in the list — are already in the Default ALC. +Additionally, assemblies that *must* remain in the Default ALC (such as +`System.Private.CoreLib`) always load there. These assemblies cannot be +controlled by the isolated context. + +### Custom `AssemblyResolve` / `Resolving` handlers in application code + +If the application subscribes to `AppDomain.CurrentDomain.AssemblyResolve` +or `AssemblyLoadContext.Default.Resolving` and loads a **different +version** of an assembly that the instrumentation has already resolved, +the behavior is unpredictable: + +- If the instrumentation's handler resolved first (assembly binding is + cached), the application's handler will never fire for that reference. +- If the application's handler runs first (for example, it was + subscribed before the instrumentation), it may load a version that the + instrumentation is incompatible with. + +This scenario is relatively rare because few applications implement +custom assembly resolution, but it can occur in plugin-based +architectures. + +### Native profiler: conflicting version ordering + +The native profiler processes assembly references in module-load order. +If an earlier module has been redirected to the instrumentation's version +and a later module references a **higher** version than the +instrumentation ships, the profiler cannot reconcile the two. This is +logged as an error. In practice this is rare because the instrumentation +ships the latest versions of its dependencies. + +## Troubleshooting + +1. **Enable debug logging** — set `OTEL_LOG_LEVEL=debug`. The assembly + resolver logs every resolution attempt, including which path and ALC + was used. +2. **Enable host tracing** — set `COREHOST_TRACE=1` and + `COREHOST_TRACEFILE=corehost_verbose_tracing.log` to capture the + runtime's own assembly-loading decisions. +3. **Review the native profiler log** — look for + `RedirectAssemblyReferences` entries to confirm that IL rewriting + happened and which versions were involved. + +### Last resort: `DOTNET_ADDITIONAL_DEPS` and the runtime store + +If the above strategies do not resolve a conflict — for example, the +application uses a framework-level assembly that cannot be redirected — +you can configure the .NET host to include additional dependencies at +startup using +[`DOTNET_ADDITIONAL_DEPS`](https://learn.microsoft.com/dotnet/core/dependency-loading/understanding-assemblyloadcontext#additional-deps) +and +[`DOTNET_SHARED_STORE`](https://learn.microsoft.com/dotnet/core/deploying/runtime-store) +environment variables. This approach makes the runtime aware of the +instrumentation's assemblies before the application starts, avoiding +version conflicts entirely. However, it requires preparing a +`.deps.json` file and potentially a shared store layout — a significant +effort compared to the other deployment options. Consult the +[.NET documentation](https://learn.microsoft.com/dotnet/core/dependency-loading/understanding-assemblyloadcontext) +for details. diff --git a/docs/config.md b/docs/config.md index e4b4646b58..72420f37dc 100644 --- a/docs/config.md +++ b/docs/config.md @@ -25,7 +25,7 @@ with environment variables taking precedence over `App.config` or `Web.config` f - `OTEL_DOTNET_AUTO_[TRACES|METRICS|LOGS]_{INSTRUMENTATION_ID}_INSTRUMENTATION_ENABLED` - `OTEL_DOTNET_AUTO_LOG_DIRECTORY` - `OTEL_LOG_LEVEL` - - `OTEL_DOTNET_AUTO_NETFX_REDIRECT_ENABLED` + - `OTEL_DOTNET_AUTO_REDIRECT_ENABLED` - `OTEL_DOTNET_AUTO_SQLCLIENT_NETFX_ILREWRITE_ENABLED` Example with `OTEL_SERVICE_NAME` setting: @@ -437,7 +437,7 @@ Important environment variables include: | `OTEL_DOTNET_AUTO_OPENTRACING_ENABLED` | Enables OpenTracing tracer. | `false` | [Deprecated](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | | `OTEL_DOTNET_AUTO_LOGS_ENABLED` | Enables logs. | `true` | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | | `OTEL_DOTNET_AUTO_METRICS_ENABLED` | Enables metrics. | `true` | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | -| `OTEL_DOTNET_AUTO_NETFX_REDIRECT_ENABLED` | Enables automatic redirection of the assemblies used by the automatic instrumentation on the .NET Framework. | `true` | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | +| `OTEL_DOTNET_AUTO_REDIRECT_ENABLED` | Enables native redirection of the assemblies used by the automatic instrumentation. Recommended to be enabled for Native profiler based standalone installation and should be disabled for NuGet installation. | `true` | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | | `OTEL_DOTNET_AUTO_TRACES_ADDITIONAL_SOURCES` | Comma-separated list of additional `System.Diagnostics.ActivitySource` names to be added to the tracer at the startup. Use it to capture manually instrumented spans. | | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | | `OTEL_DOTNET_AUTO_TRACES_ADDITIONAL_LEGACY_SOURCES` | Comma-separated list of additional legacy source names to be added to the tracer at the startup. Use it to capture `System.Diagnostics.Activity` objects created without using the `System.Diagnostics.ActivitySource` API. | | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | | `OTEL_DOTNET_AUTO_FLUSH_ON_UNHANDLEDEXCEPTION` | Controls whether the telemetry data is flushed when an [AppDomain.UnhandledException](https://docs.microsoft.com/en-us/dotnet/api/system.appdomain.unhandledexception) event is raised. Set to `true` when you suspect that you are experiencing a problem with missing telemetry data and also experiencing unhandled exceptions. | `false` | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | @@ -500,15 +500,9 @@ On .NET it is required to set the [`DOTNET_STARTUP_HOOKS`](https://github.com/dotnet/runtime/blob/main/docs/design/features/host-startup-hook.md) environment variable if the .NET CLR Profiler is not used. -The [`DOTNET_ADDITIONAL_DEPS`](https://github.com/dotnet/runtime/blob/main/docs/design/features/additional-deps.md) -and [`DOTNET_SHARED_STORE`](https://docs.microsoft.com/en-us/dotnet/core/deploying/runtime-store) -environment variable are used to mitigate assembly version conflicts in .NET. - | Environment variable | Required value | Status | |--------------------------|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------| | `DOTNET_STARTUP_HOOKS` | `$INSTALL_DIR/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll` | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | -| `DOTNET_ADDITIONAL_DEPS` | `$INSTALL_DIR/AdditionalDeps` | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | -| `DOTNET_SHARED_STORE` | `$INSTALL_DIR/store` | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) | If the .NET CLR Profiler is used and the [`DOTNET_STARTUP_HOOKS`](https://github.com/dotnet/runtime/blob/main/docs/design/features/host-startup-hook.md) diff --git a/docs/design.md b/docs/design.md index 55fa520836..5043abde35 100644 --- a/docs/design.md +++ b/docs/design.md @@ -206,64 +206,40 @@ to access objects from the APIs being instrumented. ### Assembly conflict resolution -The injection of the OpenTelemetry .NET SDK and any source instrumentation brings -the risk of assembly version conflicts. This issue is more likely with the -[NuGet package System.Diagnostic.DiagnosticSource](https://www.nuget.org/packages/System.Diagnostics.DiagnosticSource/) -and its dependencies, because it contains the [Activity type](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activity?view=net-5.0) -used by the OpenTelemetry .NET API to represent a span. This package, previously -released by Microsoft, is already used by various applications. - -Two issues might arise from incorrect versioning: - -1. Version required by the OpenTelemetry .NET SDK or the instrumentations - is not met. -2. Multiple versions of the assembly in the same process, - as the runtime treats them independently. - -On the .NET Framework, by default, the CLR Profiler redirects any -assembly references to the versions shipped with the Managed Profiler. - -#### Configuration resolution - -.NET [Framework-dependent deployment](https://docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-cli#framework-dependent-deployment) -applications might use [DOTNET_ADDITIONAL_DEPS](https://github.com/dotnet/runtime/blob/main/docs/design/features/additional-deps.md) -and [DOTNET_SHARED_STORE](https://docs.microsoft.com/en-us/dotnet/core/deploying/runtime-store) -from OpenTelemetry .NET Automatic Instrumentation installation location -to resolve assembly conflicts. - -#### Build time resolution - -Currently, the path to resolving such conflicts is to add or update any package -reference used by the application to the versions required by -the OpenTelemetry .NET SDK and the instrumentations. -Even if the application itself doesn't directly reference a conflicting -dependency, this might still be necessary due to conflicts created by -any indirect dependency. - -Adding or updating package references works because of the way -[NuGet Package Dependency Resolution](https://docs.microsoft.com/en-us/nuget/concepts/dependency-resolution) -is implemented. Conflicts are resolved by having explicit package references -to the correct package versions. - -To simplify this process, we plan to create a NuGet package that installs -the CLR Profiler and its managed dependencies. - -#### Runtime time resolution - -If you can't change the application build to add or update the necessary package -versions, you can still address conflicts using the methods described in -[Handling of Assembly version Conflicts](./troubleshooting.md#handling-of-assembly-version-conflicts). - -### `System.Diagnostics.DiagnosticSource` versions - -The version of `System.Diagnostics.DiagnosticSource` used by the instrumentation -differs depending on the .NET version: - -- .NET Framework is referencing the latest supported version. - Automatic redirection is forcing this version - if instrumented application bring own copy. -- .NET is referencing the lowest supported version. - The version can be upgraded by the instrumented application. +The injection of the OpenTelemetry .NET SDK and any source instrumentation +brings the risk of assembly version conflicts. This issue is more likely with +packages like +[`System.Diagnostics.DiagnosticSource`](https://www.nuget.org/packages/System.Diagnostics.DiagnosticSource/) +which contains the [`Activity` type](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activity?view=net-5.0) +used by the OpenTelemetry .NET API to represent a span. If not handled, +conflicts can lead to: + +1. APIs required by the OpenTelemetry SDK being unavailable +2. Multiple versions of the same assembly loaded in the process + +#### Deployment-specific resolution strategies + +The approach to resolving conflicts differs by deployment mode: + +- **NuGet package deployment**: Versions are resolved at build time by + NuGet's dependency resolution. The + `OTEL_DOTNET_AUTO_REDIRECT_ENABLED` environment variable has no effect + and should be disabled to avoid unnecessary overhead. + +- **Native Profiler deployment**: The CLR Profiler redirects assembly + references to the instrumentation's versions if they are higher (enabled + by default, but can be disabled by setting + `OTEL_DOTNET_AUTO_REDIRECT_ENABLED = false` if needed). The **Loader** + then handles runtime resolution using `AssemblyLoadContext` (.NET) or + `AppDomain.AssemblyResolve` (.NET Framework) to resolve assembly + conflicts. + +- **StartupHook-only deployment** (.NET only): A full isolation of + application in custom `AssemblyLoadContext`. + +**For a comprehensive explanation of how the .NET runtime resolves +assemblies and the resolution strategies for each deployment mode, see +[Assembly Conflict Resolution](./assembly-conflict-resolution.md).** ## Further reading diff --git a/docs/file-based-configuration.md b/docs/file-based-configuration.md index 17013e65c5..e041a9b438 100644 --- a/docs/file-based-configuration.md +++ b/docs/file-based-configuration.md @@ -50,7 +50,7 @@ file-based configuration to include these parameters. | `OTEL_DOTNET_AUTO_HOME` | Installation location. | | `OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES` | Names of the executable files that the profiler cannot instrument. | | `OTEL_DOTNET_AUTO_OPENTRACING_ENABLED` | Enables OpenTracing tracer. | -| `OTEL_DOTNET_AUTO_NETFX_REDIRECT_ENABLED` | Enables automatic redirection of the assemblies used by the automatic instrumentation on the .NET Framework. | +| `OTEL_DOTNET_AUTO_REDIRECT_ENABLED` | Enables automatic redirection of the assemblies used by the automatic instrumentation. | --- @@ -106,8 +106,6 @@ file-based configuration to include these parameters. | Environment variable | Description | |--------------------------|------------------------------------------------------| | `DOTNET_STARTUP_HOOKS` | Specifies managed assemblies to load during startup. | -| `DOTNET_ADDITIONAL_DEPS` | Additional .deps.json files to include. | -| `DOTNET_SHARED_STORE` | Path to additional shared assemblies. | --- diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 2cd6d1d612..444b19fa57 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -154,29 +154,31 @@ to use the same versions as OpenTelemetry .NET Automatic Instrumentation. The following dependencies are used by OpenTelemetry .NET Automatic Instrumentation: - [OpenTelemetry.AutoInstrumentation](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj) -- [OpenTelemetry.AutoInstrumentation.AdditionalDeps](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Build.props) Find their versions in the following locations: - [Directory.Packages.props](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/Directory.Packages.props) - [src/Directory.Packages.props](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/src/Directory.Packages.props) -- [src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Packages.props](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Packages.props) +- [src/OpenTelemetry.AutoInstrumentation.Assemblies/Directory.Packages.props](../src/OpenTelemetry.AutoInstrumentation.Assemblies/Directory.Packages.props) -By default, assembly references for .NET Framework applications are redirected -during runtime to the versions used by the automatic instrumentation. -This behavior can be controlled through the [`OTEL_DOTNET_AUTO_NETFX_REDIRECT_ENABLED`](./config.md#additional-settings) +For non-NuGet installations, the startup scripts automatically configure assembly +redirection at runtime. +This behavior can be controlled through the [`OTEL_DOTNET_AUTO_REDIRECT_ENABLED`](./config.md#additional-settings) setting. If the application already ships binding redirection for assemblies used by automatic instrumentation this automatic redirection may fail, see [#2833](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/2833). Check if any existing binding redirect prevent redirection to the versions -listed at [netfx_assembly_redirection.h](../src/OpenTelemetry.AutoInstrumentation.Native/netfx_assembly_redirection.h). +listed at [assembly_redirection_net.h](../src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_net.h) +for .NET application +and [assembly_redirection_netfx.h](../src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_netfx.h) +for .NET Framework application. For the automatic redirection above to work there are two specific scenarios that -require the assemblies used to instrument .NET Framework -applications, the ones under the `netfx` folder of the installation directory, -to be also installed into the Global Assembly Cache (GAC): +require the assemblies used to instrument .NET Framework applications, +the ones under the `netfx` folder of the installation directory, to be also installed +into the Global Assembly Cache (GAC): 1. [__Monkey patch instrumentation__](https://en.wikipedia.org/wiki/Monkey_patch#:~:text=Monkey%20patching%20is%20a%20technique,Python%2C%20Groovy%2C%20etc.) of assemblies loaded as domain-neutral. @@ -190,46 +192,3 @@ are updated. For more information about the GAC usage by the automatic instrumentation, see issue [#1906](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/1906#issuecomment-1376292814). - -### Assembly in AdditionalDeps was not found - -#### Symptoms - -You get an error message similar to the following: - -```txt -An assembly specified in the application dependencies manifest (OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json) was not found -``` - -#### Related issues - -- [#1744](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/1744) -- [#2181](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/2181) - -#### Solution - -If you encounter an issue not listed on this page, see [General steps](#general-steps) -to collect additional diagnostic information. This might help facilitate troubleshooting. - -### Runtime Store Assembly Version Conflicts - -#### Symptoms - -Applications may crash or behave unexpectedly due to version mismatches between -the application's assemblies and those in the .NET runtime store. The -RuntimeStoreDiagnosticRule in RuleEngine helps identify these mismatches by -logging a warning if the application references a lower version than the runtime -store. - -Sample Diagnostic Output: - -```plaintext -[Warning] Rule Engine: Application references lower version of runtime store assembly C:\path\to\assembly.dll - 6.0.0.0. -[Debug] Rule Engine: Runtime store assembly C:\path\to\assembly.dll validated successfully. -``` - -#### Solution - -For resolving runtime store assembly version conflicts, follow the same solution -as outlined for [Assembly version conflicts](#assembly-version-conflicts) in -this document. diff --git a/examples/playground/AspNetCoreMvc/Properties/launchSettings.json b/examples/playground/AspNetCoreMvc/Properties/launchSettings.json index 3676f0e6fd..9bf5e6073b 100644 --- a/examples/playground/AspNetCoreMvc/Properties/launchSettings.json +++ b/examples/playground/AspNetCoreMvc/Properties/launchSettings.json @@ -13,8 +13,6 @@ "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", @@ -33,8 +31,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_DOTNET_AUTO_PLUGINS": "Examples.AspNetCoreMvc.OtelSdkPlugin, Examples.AspNetCoreMvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", @@ -49,8 +45,6 @@ "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", @@ -74,8 +68,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", diff --git a/instrument.sh b/instrument.sh index 8a39c0ad06..9b0fe0844d 100755 --- a/instrument.sh +++ b/instrument.sh @@ -107,20 +107,6 @@ fi export OTEL_DOTNET_AUTO_HOME # Configure .NET Core Runtime -DOTNET_ADDITIONAL_DEPS=${DOTNET_ADDITIONAL_DEPS:-} -if [ -z "$DOTNET_ADDITIONAL_DEPS" ]; then - export DOTNET_ADDITIONAL_DEPS="${OTEL_DOTNET_AUTO_HOME}/AdditionalDeps" -else - export DOTNET_ADDITIONAL_DEPS="${OTEL_DOTNET_AUTO_HOME}/AdditionalDeps${SEPARATOR}${DOTNET_ADDITIONAL_DEPS}" -fi - -DOTNET_SHARED_STORE=${DOTNET_SHARED_STORE:-} -if [ -z "$DOTNET_SHARED_STORE" ]; then - export DOTNET_SHARED_STORE="${OTEL_DOTNET_AUTO_HOME}/store" -else - export DOTNET_SHARED_STORE="${OTEL_DOTNET_AUTO_HOME}/store${SEPARATOR}${DOTNET_SHARED_STORE}" -fi - DOTNET_STARTUP_HOOKS=${DOTNET_STARTUP_HOOKS:-} if [ -z "$DOTNET_STARTUP_HOOKS" ]; then export DOTNET_STARTUP_HOOKS="${OTEL_DOTNET_AUTO_HOME}/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll" diff --git a/nuget/OpenTelemetry.AutoInstrumentation/contentFiles/any/any/instrument.cmd b/nuget/OpenTelemetry.AutoInstrumentation/contentFiles/any/any/instrument.cmd index d91a563b31..3c7c716cbd 100644 --- a/nuget/OpenTelemetry.AutoInstrumentation/contentFiles/any/any/instrument.cmd +++ b/nuget/OpenTelemetry.AutoInstrumentation/contentFiles/any/any/instrument.cmd @@ -40,12 +40,12 @@ Attempting to use the native profiler from runtimes\win-x64\native and runtimes\ set COR_ENABLE_PROFILING=1 set COR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} -:: On .NET Framework automatic assembly redirection MUST be disabled. This setting -:: is ignored on .NET. This is necessary because the NuGet package doesn't bring -:: the pre-defined versions of the transitive dependencies used in the automatic -:: redirection. Instead the transitive dependencies versions are determined by +:: Automatic assembly redirection MUST be disabled. This is necessary +:: because the NuGet package doesn't bring the pre-defined versions +:: of the transitive dependencies used in the automatic redirection. +:: Instead the transitive dependencies versions are determined by :: the NuGet version resolution algorithm when building the application. -set OTEL_DOTNET_AUTO_NETFX_REDIRECT_ENABLED=false +set OTEL_DOTNET_AUTO_REDIRECT_ENABLED=false :: Settings for .NET set ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper diff --git a/script-templates/OpenTelemetry.DotNet.Auto.psm1.template b/script-templates/OpenTelemetry.DotNet.Auto.psm1.template index 49c5d3c4a2..bc9e08bc94 100644 --- a/script-templates/OpenTelemetry.DotNet.Auto.psm1.template +++ b/script-templates/OpenTelemetry.DotNet.Auto.psm1.template @@ -94,8 +94,6 @@ function Get-Environment-Variables-Table([string]$InstallDir, [string]$OTelServi $CORECLR_PROFILER_PATH_32 = Join-Path $InstallDir "/win-x86/OpenTelemetry.AutoInstrumentation.Native.dll" $CORECLR_PROFILER_PATH_64 = Join-Path $InstallDir "/win-x64/OpenTelemetry.AutoInstrumentation.Native.dll" - $DOTNET_ADDITIONAL_DEPS = Join-Path $InstallDir "AdditionalDeps" - $DOTNET_SHARED_STORE = Join-Path $InstallDir "store" $DOTNET_STARTUP_HOOKS = Join-Path $InstallDir "net/OpenTelemetry.AutoInstrumentation.StartupHook.dll" $OTEL_DOTNET_AUTO_HOME = $InstallDir @@ -114,8 +112,6 @@ function Get-Environment-Variables-Table([string]$InstallDir, [string]$OTelServi # ASP.NET Core "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" = "OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper"; # .NET Common - "DOTNET_ADDITIONAL_DEPS" = $DOTNET_ADDITIONAL_DEPS; - "DOTNET_SHARED_STORE" = $DOTNET_SHARED_STORE; "DOTNET_STARTUP_HOOKS" = $DOTNET_STARTUP_HOOKS; # OpenTelemetry "OTEL_DOTNET_AUTO_HOME" = $OTEL_DOTNET_AUTO_HOME; @@ -163,8 +159,6 @@ function Cleanup-Environment-Variables([string]$WindowsServiceName) { # ASP.NET Core "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", # .NET Common - "DOTNET_ADDITIONAL_DEPS", - "DOTNET_SHARED_STORE", "DOTNET_STARTUP_HOOKS", # OpenTelemetry "OTEL_DOTNET_" @@ -603,8 +597,6 @@ function Unregister-OpenTelemetryForCurrentSession() { $env:ASPNETCORE_HOSTINGSTARTUPASSEMBLIES = $null # .NET Common - $env:DOTNET_ADDITIONAL_DEPS = $null - $env:DOTNET_SHARED_STORE = $null $env:DOTNET_STARTUP_HOOKS = $null # OpenTelemetry diff --git a/src/CommonExcludedAssets.props b/src/CommonExcludedAssets.props index 938c4f4114..d9ff2ea0b9 100644 --- a/src/CommonExcludedAssets.props +++ b/src/CommonExcludedAssets.props @@ -1,13 +1,20 @@ - - - + + - + - + + + + + + + + + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index dda4874ed9..2323dcf475 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -1,17 +1,14 @@ - - + - - + - - + @@ -35,18 +32,26 @@ - - + - - + + + + + - - + + + + + + + + \ No newline at end of file diff --git a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Build.props b/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Build.props deleted file mode 100644 index 1d7f6757a1..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Build.props +++ /dev/null @@ -1,10 +0,0 @@ - - - $(NoWarn);NU1510 - - - - - - - diff --git a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Packages.props b/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Packages.props deleted file mode 100644 index e238f8ea54..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Packages.props +++ /dev/null @@ -1,10 +0,0 @@ - - - true - - - - - - - diff --git a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/OpenTelemetry.AutoInstrumentation.AdditionalDeps.csproj b/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/OpenTelemetry.AutoInstrumentation.AdditionalDeps.csproj deleted file mode 100644 index b5839064b2..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/OpenTelemetry.AutoInstrumentation.AdditionalDeps.csproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - net10.0;net9.0;net8.0 - $(NoWarn);NU1510 - - - - - $(OutputDir)\AdditionalDeps - $(OutputDir)\store\ - $(TracerHomePath)\AdditionalDeps - $(TracerHomePath)\store - x64 - - - - - x86 - $(StoreOutputBasePath) - - - x64 - $(StoreOutputBasePath) - - - arm64 - $(StoreOutputBasePath) - - - - - - - - TargetFramework=$(TargetFramework);PlatformTarget=%(StoreRuntime.Platform);RuntimeIdentifier=%(StoreRuntime.Identity);SkipOptimization=true;ComposeDir=%(StoreRuntime.StorePath);CreateProfilingSymbols=false;Version=$(SemanticVersion4parts);NuGetPackageRootOriginal=$(NuGetPackageRoot);Environment=$(Environment) - - - - - - diff --git a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Package.xml b/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Package.xml deleted file mode 100644 index 1aedaf9112..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Package.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - https://api.nuget.org/v3/index.json;$(TracerHomePath)\AdditionalDeps; - - - - - diff --git a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/docs/README.md b/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/docs/README.md deleted file mode 100644 index bc20b15868..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/docs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Using the OpenTelemetry.AutoInstrumentation.AdditionalDeps NuGet package - -This is dependency of OpenTelemetry.AutoInstrumentation NuGet package. -Check [this README](https://www.nuget.org/packages/OpenTelemetry.AutoInstrumentation/#readme-body-tab) -for details. diff --git a/src/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework/Directory.Packages.props b/src/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework/Directory.Packages.props deleted file mode 100644 index 5f73573208..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework/Directory.Packages.props +++ /dev/null @@ -1,43 +0,0 @@ - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework.csproj b/src/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework.csproj deleted file mode 100644 index d174f2c4eb..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - net462;net47;net471;net472 - none - false - false - true - false - false - - - - - - - diff --git a/src/OpenTelemetry.AutoInstrumentation.Assemblies/Directory.Packages.props b/src/OpenTelemetry.AutoInstrumentation.Assemblies/Directory.Packages.props new file mode 100644 index 0000000000..d073c0513b --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.Assemblies/Directory.Packages.props @@ -0,0 +1,98 @@ + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/OpenTelemetry.AutoInstrumentation.Assemblies/OpenTelemetry.AutoInstrumentation.Assemblies.csproj b/src/OpenTelemetry.AutoInstrumentation.Assemblies/OpenTelemetry.AutoInstrumentation.Assemblies.csproj new file mode 100644 index 0000000000..bc2a37b716 --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.Assemblies/OpenTelemetry.AutoInstrumentation.Assemblies.csproj @@ -0,0 +1,36 @@ + + + + + + net8.0;net9.0;net10.0 + $(TargetFrameworks);net462;net47;net471;net472 + none + false + false + true + false + false + + true + + + + + + + + + + + + + diff --git a/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.Net.cs b/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.Net.cs index becfc9c319..b61e6699af 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.Net.cs +++ b/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.Net.cs @@ -1,104 +1,91 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#if NET using System.Reflection; -using System.Runtime.InteropServices; +using System.Runtime.Loader; +using OpenTelemetry.AutoInstrumentation.Logging; +using OpenTelemetry.AutoInstrumentation.Util; namespace OpenTelemetry.AutoInstrumentation.Loader; /// /// A class that attempts to load the OpenTelemetry.AutoInstrumentation .NET assembly. /// -internal partial class AssemblyResolver +internal partial class AssemblyResolver(IOtelLogger logger) { - internal static System.Runtime.Loader.AssemblyLoadContext DependencyLoadContext { get; } = new ManagedProfilerAssemblyLoadContext(); + internal static AssemblyLoadContext DependencyLoadContext { get; } = new AssemblyLoadContext("OpenTelemetry.AutoInstrumentation.Loader.AssemblyResolver", false); - internal static string[]? StoreFiles { get; } = GetStoreFiles(); + internal static string[] TrustedPlatformAssemblyNames { get; } = GetTrustedPlatformAssemblyNames(); - internal Assembly? AssemblyResolve_ManagedProfilerDependencies(object? sender, ResolveEventArgs args) + internal void RegisterAssemblyResolving() { - var assemblyName = new AssemblyName(args.Name); - _logger.Debug($"Check assembly {assemblyName}"); + // ASSEMBLY RESOLUTION STRATEGY + // + // === NATIVE PROFILER DEPLOYMENT === + // The native profiler already redirected (IL rewriting) all references to our versions. + // The Resolving event fires when runtime cannot find the assembly in two cases: + // + // Case 1: Assembly NOT in TrustedPlatformAssembly list (our dependencies; e.g., OpenTelemetry.dll) + // -> Runtime has no default location for this assembly + // -> Resolving event fires + // -> We load to Default AssemblyLoadContext (no version conflict risk) + // + // Case 2: Assembly IN TPA with lower version (conflict) + // -> Customer's TPA has lower version, profiler redirects to higher version + // -> Runtime cannot satisfy higher version due to TPA conflict + // -> Resolving event fires + // -> We load to Custom ALC for isolation (loading to Default ALC will fail) + // -> NOTE: If TPA has same/higher version, runtime successfully auto-loads to Default ALC; + // event never fires (accepted) - // On .NET Framework, having a non-US locale can cause mscorlib - // to enter the AssemblyResolve event when searching for resources - // in its satellite assemblies. This seems to have been fixed in - // .NET Core in the 2.0 servicing branch, so we should not see this - // occur, but guard against it anyways. If we do see it, exit early - // so we don't cause infinite recursion. - if (string.Equals(assemblyName.Name, "System.Private.CoreLib.resources", StringComparison.OrdinalIgnoreCase) || - string.Equals(assemblyName.Name, "System.Net.Http", StringComparison.OrdinalIgnoreCase)) - { - return null; - } - - var path = Path.Combine(_managedProfilerDirectory, $"{assemblyName.Name}.dll"); - - // Only load the main profiler into the default Assembly Load Context. - // If OpenTelemetry.AutoInstrumentation or other libraries are provided by the NuGet package their loads are handled in the following two ways. - // 1) The AssemblyVersion is greater than or equal to the version used by OpenTelemetry.AutoInstrumentation, the assembly - // will load successfully and will not invoke this resolve event. - // 2) The AssemblyVersion is lower than the version used by OpenTelemetry.AutoInstrumentation, the assembly will fail to load - // and invoke this resolve event. It must be loaded in a separate AssemblyLoadContext since the application will only - // load the originally referenced version - if (assemblyName.Name != null && assemblyName.Name.StartsWith("OpenTelemetry.AutoInstrumentation", StringComparison.OrdinalIgnoreCase) && File.Exists(path)) - { - _logger.Debug("Loading {0} with Assembly.LoadFrom", path); - return Assembly.LoadFrom(path); - } - else if (File.Exists(path)) - { - _logger.Debug("Loading {0} with DependencyLoadContext.LoadFromAssemblyPath", path); - return DependencyLoadContext.LoadFromAssemblyPath(path); // Load unresolved framework and third-party dependencies into a custom Assembly Load Context - } - else - { - var entry = StoreFiles?.FirstOrDefault(e => e.EndsWith($"{assemblyName.Name}.dll", StringComparison.Ordinal)); - if (entry != null) - { - return DependencyLoadContext.LoadFromAssemblyPath(entry); - } + // ASSEMBLY RESOLUTION TIMING + // + // When the runtime cannot find an assembly, AssemblyLoadContext.Default.Resolving fires before + // AppDomain.CurrentDomain.AssemblyResolve, so we subscribe to the former for guaranteed control. + // + // While we could subscribe to AppDomain.CurrentDomain.AssemblyResolve, the timing of this + // subscription relative to the built-in handler (Assembly.LoadFromResolveHandler) subscription is + // unpredictable and fragile to code changes. If the built-in handler runs first, it loads co-located + // assemblies (our layout - OpenTelemetry.dll library and its dependency System.Diagnostics.DiagnosticSource.dll) + // into the Default context via Assembly.LoadFrom, causing loading failure if the customer application + // has the same dependency but to a lower version (in the example above, DiagnosticSource dll) - return null; - } + AssemblyLoadContext.Default.Resolving += Resolving_ManagedProfilerDependencies; } - private static string[]? GetStoreFiles() + private static string[] GetTrustedPlatformAssemblyNames() { - try - { - var storeDirectory = Environment.GetEnvironmentVariable("DOTNET_SHARED_STORE"); - if (storeDirectory == null || !Directory.Exists(storeDirectory)) - { - return null; - } - - var architecture = RuntimeInformation.ProcessArchitecture switch - { - Architecture.X86 => "x86", - Architecture.Arm64 => "arm64", - _ => "x64" // Default to x64 for architectures not explicitly handled - }; + return [.. TrustedPlatformAssembliesHelper.TpaPaths.Select(Path.GetFileNameWithoutExtension).OfType()]; + } - var targetFramework = $"net{Environment.Version.Major}.{Environment.Version.Minor}"; - var finalPath = Path.Combine(storeDirectory, architecture, targetFramework); + private Assembly? Resolving_ManagedProfilerDependencies(AssemblyLoadContext context, AssemblyName assemblyName) + { + logger.Debug($"Check assembly: ({assemblyName})"); - var storeFiles = Directory.GetFiles(finalPath, "Microsoft.Extensions*.dll", SearchOption.AllDirectories); - return storeFiles; + if (assemblyName.Name is null) + { + logger.Debug($"Skip resolving assembly with null name"); + return null; } - catch + + // TODO we may want to cache assembly paths for assemblies loading to custom ALC to avoid repeated file system calls on every resolution, + // or simply check if the assembly is already loaded into custom ALC but that require rewriting the logic a bit + var assemblyPath = ManagedProfilerLocationHelper.GetAssemblyPath(assemblyName.Name, logger); + if (assemblyPath is null) { + logger.Debug($"Skip resolving unexpected assembly: ({assemblyName})"); return null; } - } - private string ResolveManagedProfilerDirectory() - { - string tracerFrameworkDirectory = "net"; - string tracerHomeDirectory = ReadEnvironmentVariable("OTEL_DOTNET_AUTO_HOME") ?? string.Empty; + // Load conflicting library into a custom ALC + if (TrustedPlatformAssemblyNames.Contains(assemblyName.Name)) + { + logger.Debug($"Loading \"{assemblyPath}\" with DependencyLoadContext.LoadFromAssemblyPath"); + return DependencyLoadContext.LoadFromAssemblyPath(assemblyPath); + } - return Path.Combine(tracerHomeDirectory, tracerFrameworkDirectory); + // else load into default ALC + logger.Debug($"Loading \"{assemblyPath}\" with AssemblyLoadContext.Default.LoadFromAssemblyPath"); + return AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyPath); } } -#endif diff --git a/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.NetFramework.cs b/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.NetFramework.cs index d866a9248e..8361d72c1e 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.NetFramework.cs +++ b/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.NetFramework.cs @@ -1,22 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#if NETFRAMEWORK - using System.Reflection; -using System.Runtime.InteropServices; +using OpenTelemetry.AutoInstrumentation.Logging; +using OpenTelemetry.AutoInstrumentation.Util; namespace OpenTelemetry.AutoInstrumentation.Loader; /// /// A class that attempts to load the OpenTelemetry.AutoInstrumentation .NET assembly. /// -internal partial class AssemblyResolver +internal partial class AssemblyResolver(IOtelLogger logger) { - internal Assembly? AssemblyResolve_ManagedProfilerDependencies(object sender, ResolveEventArgs args) + internal void RegisterAssemblyResolving() + { + AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolve_ManagedProfilerDependencies; + } + + private Assembly? AssemblyResolve_ManagedProfilerDependencies(object sender, ResolveEventArgs args) { var assemblyName = new AssemblyName(args.Name).Name; - _logger.Debug($"Check assembly {assemblyName}"); + logger.Debug($"Check assembly {assemblyName}"); // On .NET Framework, having a non-US locale can cause mscorlib // to enter the AssemblyResolve event when searching for resources @@ -28,87 +32,26 @@ internal partial class AssemblyResolver return null; } - _logger.Debug("Requester [{0}] requested [{1}]", args.RequestingAssembly?.FullName ?? "", args.Name ?? ""); + logger.Debug("Requester [{0}] requested [{1}]", args.RequestingAssembly?.FullName ?? "", args.Name ?? ""); - var path = Path.Combine(Path.GetDirectoryName(_managedProfilerDirectory) ?? _managedProfilerDirectory, $"{assemblyName}.dll"); - if (!File.Exists(path)) + var assemblyPath = ManagedProfilerLocationHelper.GetAssemblyPath(assemblyName, logger); + if (assemblyPath is null) { - path = Path.Combine(_managedProfilerDirectory, $"{assemblyName}.dll"); - if (!File.Exists(path)) - { - var link = Path.Combine(_managedProfilerDirectory, $"{assemblyName}.dll.link"); - if (File.Exists(link)) - { - try - { - var linkPath = File.ReadAllText(link).Trim(); - path = Path.Combine(Path.GetDirectoryName(_managedProfilerDirectory) ?? _managedProfilerDirectory, linkPath, $"{assemblyName}.dll"); - } - catch (Exception ex) - { - _logger.Debug(ex, "Error reading .link file {0}", link); - } - } - else - { - // Not found - return null; - } - } - } - - if (File.Exists(path)) - { - try - { - var loadedAssembly = Assembly.LoadFrom(path); - _logger.Debug("Assembly.LoadFrom(\"{0}\") succeeded={1}", path, loadedAssembly != null); - return loadedAssembly; - } - catch (Exception ex) - { - _logger.Debug(ex, "Assembly.LoadFrom(\"{0}\") Exception: {1}", path, ex.Message); - } + logger.Debug($"Skip resolving unexpected assembly: ({assemblyName})"); + return null; } - return null; - } - - /// - /// Return redirection table used in runtime that will match TFM folder to load assemblies. - /// It may not be actual .NET Framework version. - /// - [DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)] - [DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")] - private static extern int GetNetFrameworkRedirectionVersion(); - - private string ResolveManagedProfilerDirectory() - { - var tracerHomeDirectory = ReadEnvironmentVariable("OTEL_DOTNET_AUTO_HOME") ?? string.Empty; - var tracerFrameworkDirectory = "netfx"; - - var basePath = Path.Combine(tracerHomeDirectory, tracerFrameworkDirectory); - // fallback to net462 in case of any issues - var frameworkFolderName = "net462"; try { - var detectedVersion = GetNetFrameworkRedirectionVersion(); - var candidateFolderName = detectedVersion % 10 != 0 ? $"net{detectedVersion}" : $"net{detectedVersion / 10}"; - if (Directory.Exists(Path.Combine(basePath, candidateFolderName))) - { - frameworkFolderName = candidateFolderName; - } - else - { - _logger.Warning($"Framework folder {candidateFolderName} not found. Fallback to {frameworkFolderName}."); - } + var loadedAssembly = Assembly.LoadFrom(assemblyPath); + logger.Debug("Assembly.LoadFrom(\"{0}\") succeeded={1}", assemblyPath, loadedAssembly != null); + return loadedAssembly; } catch (Exception ex) { - _logger.Warning(ex, $"Error getting .NET Framework version from native profiler. Fallback to {frameworkFolderName}."); + logger.Debug(ex, "Assembly.LoadFrom(\"{0}\") Exception: {1}", assemblyPath, ex.Message); } - return Path.Combine(basePath, frameworkFolderName); + return null; } } -#endif diff --git a/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.cs b/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.cs deleted file mode 100644 index bef778c4b7..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.Loader/AssemblyResolver.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -using OpenTelemetry.AutoInstrumentation.Logging; - -namespace OpenTelemetry.AutoInstrumentation.Loader; - -/// -/// A class that help Loader to load the OpenTelemetry.AutoInstrumentation .NET assembly. -/// -internal partial class AssemblyResolver -{ - private readonly string _managedProfilerDirectory; - - private readonly IOtelLogger _logger; - - public AssemblyResolver(IOtelLogger otelLogger) - { - _logger = otelLogger; - _managedProfilerDirectory = ResolveManagedProfilerDirectory(); - } - - private string? ReadEnvironmentVariable(string key) - { - try - { - return Environment.GetEnvironmentVariable(key); - } - catch (Exception ex) - { - _logger.Error(ex, "Error while loading environment variable {0}", key); - } - - return null; - } -} diff --git a/src/OpenTelemetry.AutoInstrumentation.Loader/Loader.cs b/src/OpenTelemetry.AutoInstrumentation.Loader/Loader.cs index 28430a96ae..e316abe1f0 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Loader/Loader.cs +++ b/src/OpenTelemetry.AutoInstrumentation.Loader/Loader.cs @@ -22,13 +22,25 @@ internal class Loader /// static Loader() { - try - { - AppDomain.CurrentDomain.AssemblyResolve += new AssemblyResolver(Logger).AssemblyResolve_ManagedProfilerDependencies; - } - catch (Exception ex) + // TODO: For NuGet-based deployment, skip AssemblyResolver or adjust it to + // assemblies layout in application output without /net or /netfx subdirectories +#if NET + // For .Net (Core) if we run in isolated context (set up by StartupHook's IsolatedAssemblyResolver), + // skip AssemblyResolver. The isolated AssemblyLoadContext already handles all assembly resolution. + var currentContext = System.Runtime.Loader.AssemblyLoadContext.CurrentContextualReflectionContext; + var isNotIsolated = currentContext == null || currentContext == System.Runtime.Loader.AssemblyLoadContext.Default; + + if (isNotIsolated) +#endif { - Logger.Error(ex, "Unable to register a callback to the CurrentDomain.AssemblyResolve event."); + try + { + new AssemblyResolver(Logger).RegisterAssemblyResolving(); + } + catch (Exception ex) + { + Logger.Error(ex, "Unable to register assembly resolving"); + } } TryLoadManagedAssembly(); diff --git a/src/OpenTelemetry.AutoInstrumentation.Loader/ManagedProfilerAssemblyLoadContext.cs b/src/OpenTelemetry.AutoInstrumentation.Loader/ManagedProfilerAssemblyLoadContext.cs deleted file mode 100644 index 6fc8b83759..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.Loader/ManagedProfilerAssemblyLoadContext.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -#if NET -using System.Reflection; -using System.Runtime.Loader; - -namespace OpenTelemetry.AutoInstrumentation.Loader; - -internal class ManagedProfilerAssemblyLoadContext : AssemblyLoadContext -{ - protected override Assembly? Load(AssemblyName assemblyName) - { - return null; - } -} -#endif diff --git a/src/OpenTelemetry.AutoInstrumentation.Loader/OpenTelemetry.AutoInstrumentation.Loader.csproj b/src/OpenTelemetry.AutoInstrumentation.Loader/OpenTelemetry.AutoInstrumentation.Loader.csproj index b1fa21e3ef..619a683f40 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Loader/OpenTelemetry.AutoInstrumentation.Loader.csproj +++ b/src/OpenTelemetry.AutoInstrumentation.Loader/OpenTelemetry.AutoInstrumentation.Loader.csproj @@ -8,61 +8,93 @@ $(NoWarn);CA1031 - - - Logging\InternalLogger.cs - - - Logging\NoopLogger.cs - - - Logging\ConsoleSink.cs - - - Logging\FileSink.cs - - - Logging\RollingFileSink.cs - - - Logging\PeriodicFlushToDiskSink.cs - - - Logging\RollingInterval.cs - - - Logging\PathRoller.cs - - - Logging\RollingLogFile.cs - - - Logging\RollingIntervalExtensions.cs - - - Logging\IOtelLogger.cs - - - Logging\ISink.cs - - - Logging\LogLevel.cs - - - Logging\LogSink.cs - - - Logging\NoopSink.cs - - - Logging\OtelLogging.cs - - - Logging\WriteCountingStream.cs - - - AutoInstrumentationEventSource.cs - - + + + + + + + + + + + + + + + + + + + + + Logging\InternalLogger.cs + + + Logging\NoopLogger.cs + + + Logging\ConsoleSink.cs + + + Logging\FileSink.cs + + + Logging\RollingFileSink.cs + + + Logging\PeriodicFlushToDiskSink.cs + + + Logging\RollingInterval.cs + + + Logging\PathRoller.cs + + + Logging\RollingLogFile.cs + + + Logging\RollingIntervalExtensions.cs + + + Logging\IOtelLogger.cs + + + Logging\ISink.cs + + + Logging\LogLevel.cs + + + Logging\LogSink.cs + + + Logging\NoopSink.cs + + + Logging\OtelLogging.cs + + + Logging\WriteCountingStream.cs + + + AutoInstrumentationEventSource.cs + + + + + + diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/OpenTelemetry.AutoInstrumentation.Native.vcxproj b/src/OpenTelemetry.AutoInstrumentation.Native/OpenTelemetry.AutoInstrumentation.Native.vcxproj index 62a30dcdb5..36a9c7349a 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Native/OpenTelemetry.AutoInstrumentation.Native.vcxproj +++ b/src/OpenTelemetry.AutoInstrumentation.Native/OpenTelemetry.AutoInstrumentation.Native.vcxproj @@ -179,6 +179,9 @@ + + + @@ -205,7 +208,6 @@ - diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection.h b/src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection.h new file mode 100644 index 0000000000..3962e07b7d --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection.h @@ -0,0 +1,24 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "assembly_redirection_netfx.h" +#include "assembly_redirection_net.h" +#include "cor_profiler.h" + +#define STR(Z1) #Z1 +#define AUTO_MAJOR STR(OTEL_AUTO_VERSION_MAJOR) + +namespace trace +{ +void CorProfiler::InitAssemblyRedirectsMap() +{ + const USHORT auto_major = atoi(AUTO_MAJOR); + + assembly_version_redirect_map_.insert({ + ASSEMBLY_REDIRECTION_NETFX, + ASSEMBLY_REDIRECTION_NET + }); +} +} diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_net.h b/src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_net.h new file mode 100644 index 0000000000..59531a1ce6 --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_net.h @@ -0,0 +1,161 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +// Auto-generated file, do not change it - generated by the AssemblyRedirectionSourceGenerator type + +// Macro to handle cross-platform UTF-16 string literals +#ifdef _WIN32 +#define _W(s) L##s +#else +#define _W(s) u##s +#endif + +#define ASSEMBLY_REDIRECTION_NET \ + { 80, { \ + { _W("Microsoft.Extensions.Configuration"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Configuration.Abstractions"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Configuration.Binder"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.DependencyInjection"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.DependencyInjection.Abstractions"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Diagnostics.Abstractions"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Logging"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Logging.Abstractions"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Logging.Configuration"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Options"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Options.ConfigurationExtensions"), {8, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Primitives"), {8, 0, 0, 0} }, \ + { _W("OpenTelemetry"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api.ProviderBuilderExtensions"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation"), {auto_major, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation.Loader"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation.StartupHook"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Console"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.OpenTelemetryProtocol"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Prometheus.HttpListener"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Zipkin"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Extensions.Propagators"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Instrumentation.AspNetCore"), {1, 15, 0, 901} }, \ + { _W("OpenTelemetry.Instrumentation.EntityFrameworkCore"), {1, 15, 0, 895} }, \ + { _W("OpenTelemetry.Instrumentation.GrpcNetClient"), {1, 15, 0, 896} }, \ + { _W("OpenTelemetry.Instrumentation.Http"), {1, 15, 0, 900} }, \ + { _W("OpenTelemetry.Instrumentation.Process"), {1, 15, 0, 892} }, \ + { _W("OpenTelemetry.Instrumentation.Quartz"), {1, 15, 0, 893} }, \ + { _W("OpenTelemetry.Instrumentation.Runtime"), {1, 15, 0, 899} }, \ + { _W("OpenTelemetry.Instrumentation.SqlClient"), {1, 15, 0, 918} }, \ + { _W("OpenTelemetry.Instrumentation.StackExchangeRedis"), {1, 15, 0, 903} }, \ + { _W("OpenTelemetry.Instrumentation.Wcf"), {1, 15, 0, 890} }, \ + { _W("OpenTelemetry.Resources.Azure"), {1, 15, 0, 889} }, \ + { _W("OpenTelemetry.Resources.Container"), {1, 15, 0, 883} }, \ + { _W("OpenTelemetry.Resources.Host"), {1, 15, 0, 917} }, \ + { _W("OpenTelemetry.Resources.OperatingSystem"), {1, 15, 0, 886} }, \ + { _W("OpenTelemetry.Resources.Process"), {1, 15, 0, 887} }, \ + { _W("OpenTelemetry.Resources.ProcessRuntime"), {1, 15, 0, 885} }, \ + { _W("OpenTelemetry.Shims.OpenTracing"), {1, 0, 0, 0} }, \ + { _W("OpenTracing"), {0, 12, 1, 0} }, \ + { _W("System.Diagnostics.DiagnosticSource"), {10, 0, 0, 0} }, \ + { _W("System.Private.ServiceModel"), {4, 7, 0, 0} }, \ + { _W("System.Security.Permissions"), {4, 0, 3, 0} }, \ + { _W("System.ServiceModel"), {4, 0, 0, 0} }, \ + { _W("System.ServiceModel.Primitives"), {4, 7, 0, 0} }, \ + }}, \ + { 90, { \ + { _W("Microsoft.Extensions.Configuration"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Configuration.Abstractions"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Configuration.Binder"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.DependencyInjection"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.DependencyInjection.Abstractions"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Diagnostics.Abstractions"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Logging"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Logging.Abstractions"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Logging.Configuration"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Options"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Options.ConfigurationExtensions"), {9, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Primitives"), {9, 0, 0, 0} }, \ + { _W("OpenTelemetry"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api.ProviderBuilderExtensions"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation"), {auto_major, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation.Loader"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation.StartupHook"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Console"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.OpenTelemetryProtocol"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Prometheus.HttpListener"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Zipkin"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Extensions.Propagators"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Instrumentation.AspNetCore"), {1, 15, 0, 901} }, \ + { _W("OpenTelemetry.Instrumentation.EntityFrameworkCore"), {1, 15, 0, 895} }, \ + { _W("OpenTelemetry.Instrumentation.GrpcNetClient"), {1, 15, 0, 896} }, \ + { _W("OpenTelemetry.Instrumentation.Http"), {1, 15, 0, 900} }, \ + { _W("OpenTelemetry.Instrumentation.Process"), {1, 15, 0, 892} }, \ + { _W("OpenTelemetry.Instrumentation.Quartz"), {1, 15, 0, 893} }, \ + { _W("OpenTelemetry.Instrumentation.Runtime"), {1, 15, 0, 899} }, \ + { _W("OpenTelemetry.Instrumentation.SqlClient"), {1, 15, 0, 918} }, \ + { _W("OpenTelemetry.Instrumentation.StackExchangeRedis"), {1, 15, 0, 903} }, \ + { _W("OpenTelemetry.Instrumentation.Wcf"), {1, 15, 0, 890} }, \ + { _W("OpenTelemetry.Resources.Azure"), {1, 15, 0, 889} }, \ + { _W("OpenTelemetry.Resources.Container"), {1, 15, 0, 883} }, \ + { _W("OpenTelemetry.Resources.Host"), {1, 15, 0, 917} }, \ + { _W("OpenTelemetry.Resources.OperatingSystem"), {1, 15, 0, 886} }, \ + { _W("OpenTelemetry.Resources.Process"), {1, 15, 0, 887} }, \ + { _W("OpenTelemetry.Resources.ProcessRuntime"), {1, 15, 0, 885} }, \ + { _W("OpenTelemetry.Shims.OpenTracing"), {1, 0, 0, 0} }, \ + { _W("OpenTracing"), {0, 12, 1, 0} }, \ + { _W("System.Diagnostics.DiagnosticSource"), {10, 0, 0, 0} }, \ + { _W("System.Private.ServiceModel"), {4, 7, 0, 0} }, \ + { _W("System.Security.Permissions"), {4, 0, 3, 0} }, \ + { _W("System.ServiceModel"), {4, 0, 0, 0} }, \ + { _W("System.ServiceModel.Primitives"), {4, 7, 0, 0} }, \ + }}, \ + { 100, { \ + { _W("Microsoft.Extensions.Configuration"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Configuration.Abstractions"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Configuration.Binder"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.DependencyInjection"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.DependencyInjection.Abstractions"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Diagnostics.Abstractions"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Logging"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Logging.Abstractions"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Logging.Configuration"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Options"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Options.ConfigurationExtensions"), {10, 0, 0, 0} }, \ + { _W("Microsoft.Extensions.Primitives"), {10, 0, 0, 0} }, \ + { _W("OpenTelemetry"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api.ProviderBuilderExtensions"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation"), {auto_major, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation.Loader"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation.StartupHook"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Console"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.OpenTelemetryProtocol"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Prometheus.HttpListener"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Zipkin"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Extensions.Propagators"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Instrumentation.AspNetCore"), {1, 15, 0, 901} }, \ + { _W("OpenTelemetry.Instrumentation.EntityFrameworkCore"), {1, 15, 0, 895} }, \ + { _W("OpenTelemetry.Instrumentation.GrpcNetClient"), {1, 15, 0, 896} }, \ + { _W("OpenTelemetry.Instrumentation.Http"), {1, 15, 0, 900} }, \ + { _W("OpenTelemetry.Instrumentation.Process"), {1, 15, 0, 892} }, \ + { _W("OpenTelemetry.Instrumentation.Quartz"), {1, 15, 0, 893} }, \ + { _W("OpenTelemetry.Instrumentation.Runtime"), {1, 15, 0, 899} }, \ + { _W("OpenTelemetry.Instrumentation.SqlClient"), {1, 15, 0, 918} }, \ + { _W("OpenTelemetry.Instrumentation.StackExchangeRedis"), {1, 15, 0, 903} }, \ + { _W("OpenTelemetry.Instrumentation.Wcf"), {1, 15, 0, 890} }, \ + { _W("OpenTelemetry.Resources.Azure"), {1, 15, 0, 889} }, \ + { _W("OpenTelemetry.Resources.Container"), {1, 15, 0, 883} }, \ + { _W("OpenTelemetry.Resources.Host"), {1, 15, 0, 917} }, \ + { _W("OpenTelemetry.Resources.OperatingSystem"), {1, 15, 0, 886} }, \ + { _W("OpenTelemetry.Resources.Process"), {1, 15, 0, 887} }, \ + { _W("OpenTelemetry.Resources.ProcessRuntime"), {1, 15, 0, 885} }, \ + { _W("OpenTelemetry.Shims.OpenTracing"), {1, 0, 0, 0} }, \ + { _W("OpenTracing"), {0, 12, 1, 0} }, \ + { _W("System.Private.ServiceModel"), {4, 7, 0, 0} }, \ + { _W("System.Security.Permissions"), {4, 0, 3, 0} }, \ + { _W("System.ServiceModel"), {4, 0, 0, 0} }, \ + { _W("System.ServiceModel.Primitives"), {4, 7, 0, 0} }, \ + }} diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_netfx.h b/src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_netfx.h new file mode 100644 index 0000000000..9d3f26a18b --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.Native/assembly_redirection_netfx.h @@ -0,0 +1,417 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +// Auto-generated file, do not change it - generated by the AssemblyRedirectionSourceGenerator type + +// Macro to handle cross-platform UTF-16 string literals +#ifdef _WIN32 +#define _W(s) L##s +#else +#define _W(s) u##s +#endif + +#define ASSEMBLY_REDIRECTION_NETFX \ + { 462, { \ + { _W("Microsoft.Bcl.AsyncInterfaces"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration.Binder"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.DependencyInjection"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.DependencyInjection.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Diagnostics.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging.Configuration"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Options"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Options.ConfigurationExtensions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Primitives"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Win32.Primitives"), {4, 0, 3, 0} }, \ + { _W("OpenTelemetry"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api.ProviderBuilderExtensions"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation"), {auto_major, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Console"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.OpenTelemetryProtocol"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Prometheus.HttpListener"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Zipkin"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Extensions.Propagators"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Instrumentation.AspNet"), {1, 15, 1, 919} }, \ + { _W("OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule"), {1, 15, 1, 919} }, \ + { _W("OpenTelemetry.Instrumentation.GrpcNetClient"), {1, 15, 0, 896} }, \ + { _W("OpenTelemetry.Instrumentation.Http"), {1, 15, 0, 900} }, \ + { _W("OpenTelemetry.Instrumentation.Process"), {1, 15, 0, 892} }, \ + { _W("OpenTelemetry.Instrumentation.Quartz"), {1, 15, 0, 893} }, \ + { _W("OpenTelemetry.Instrumentation.Runtime"), {1, 15, 0, 899} }, \ + { _W("OpenTelemetry.Instrumentation.SqlClient"), {1, 15, 0, 918} }, \ + { _W("OpenTelemetry.Instrumentation.StackExchangeRedis"), {1, 15, 0, 903} }, \ + { _W("OpenTelemetry.Instrumentation.Wcf"), {1, 15, 0, 890} }, \ + { _W("OpenTelemetry.Resources.Azure"), {1, 15, 0, 889} }, \ + { _W("OpenTelemetry.Resources.Host"), {1, 15, 0, 917} }, \ + { _W("OpenTelemetry.Resources.OperatingSystem"), {1, 15, 0, 886} }, \ + { _W("OpenTelemetry.Resources.Process"), {1, 15, 0, 887} }, \ + { _W("OpenTelemetry.Resources.ProcessRuntime"), {1, 15, 0, 885} }, \ + { _W("OpenTelemetry.Shims.OpenTracing"), {1, 0, 0, 0} }, \ + { _W("OpenTracing"), {0, 12, 1, 0} }, \ + { _W("System.AppContext"), {4, 1, 2, 0} }, \ + { _W("System.Buffers"), {4, 0, 5, 0} }, \ + { _W("System.Collections"), {4, 0, 11, 0} }, \ + { _W("System.Collections.Concurrent"), {4, 0, 11, 0} }, \ + { _W("System.Collections.NonGeneric"), {4, 0, 3, 0} }, \ + { _W("System.Collections.Specialized"), {4, 0, 3, 0} }, \ + { _W("System.ComponentModel"), {4, 0, 1, 0} }, \ + { _W("System.ComponentModel.EventBasedAsync"), {4, 0, 11, 0} }, \ + { _W("System.ComponentModel.Primitives"), {4, 1, 2, 0} }, \ + { _W("System.ComponentModel.TypeConverter"), {4, 1, 2, 0} }, \ + { _W("System.Console"), {4, 0, 2, 0} }, \ + { _W("System.Data.Common"), {4, 2, 0, 0} }, \ + { _W("System.Diagnostics.Contracts"), {4, 0, 1, 0} }, \ + { _W("System.Diagnostics.Debug"), {4, 0, 11, 0} }, \ + { _W("System.Diagnostics.DiagnosticSource"), {10, 0, 0, 2} }, \ + { _W("System.Diagnostics.FileVersionInfo"), {4, 0, 2, 0} }, \ + { _W("System.Diagnostics.Process"), {4, 1, 2, 0} }, \ + { _W("System.Diagnostics.StackTrace"), {4, 1, 0, 0} }, \ + { _W("System.Diagnostics.TextWriterTraceListener"), {4, 0, 2, 0} }, \ + { _W("System.Diagnostics.Tools"), {4, 0, 1, 0} }, \ + { _W("System.Diagnostics.TraceSource"), {4, 0, 2, 0} }, \ + { _W("System.Diagnostics.Tracing"), {4, 2, 0, 0} }, \ + { _W("System.Drawing.Primitives"), {4, 0, 2, 0} }, \ + { _W("System.Dynamic.Runtime"), {4, 0, 11, 0} }, \ + { _W("System.Globalization"), {4, 0, 11, 0} }, \ + { _W("System.Globalization.Calendars"), {4, 0, 3, 0} }, \ + { _W("System.Globalization.Extensions"), {4, 1, 0, 0} }, \ + { _W("System.IO"), {4, 1, 2, 0} }, \ + { _W("System.IO.Compression"), {4, 2, 0, 0} }, \ + { _W("System.IO.Compression.ZipFile"), {4, 0, 3, 0} }, \ + { _W("System.IO.FileSystem"), {4, 0, 3, 0} }, \ + { _W("System.IO.FileSystem.DriveInfo"), {4, 0, 2, 0} }, \ + { _W("System.IO.FileSystem.Primitives"), {4, 0, 3, 0} }, \ + { _W("System.IO.FileSystem.Watcher"), {4, 0, 2, 0} }, \ + { _W("System.IO.IsolatedStorage"), {4, 0, 2, 0} }, \ + { _W("System.IO.MemoryMappedFiles"), {4, 0, 2, 0} }, \ + { _W("System.IO.Pipelines"), {10, 0, 0, 2} }, \ + { _W("System.IO.Pipes"), {4, 0, 2, 0} }, \ + { _W("System.IO.UnmanagedMemoryStream"), {4, 0, 3, 0} }, \ + { _W("System.Linq"), {4, 1, 2, 0} }, \ + { _W("System.Linq.Expressions"), {4, 1, 2, 0} }, \ + { _W("System.Linq.Parallel"), {4, 0, 1, 0} }, \ + { _W("System.Linq.Queryable"), {4, 0, 1, 0} }, \ + { _W("System.Memory"), {4, 0, 5, 0} }, \ + { _W("System.Net.Http"), {4, 2, 0, 0} }, \ + { _W("System.Net.NameResolution"), {4, 0, 2, 0} }, \ + { _W("System.Net.NetworkInformation"), {4, 1, 2, 0} }, \ + { _W("System.Net.Ping"), {4, 0, 2, 0} }, \ + { _W("System.Net.Primitives"), {4, 0, 11, 0} }, \ + { _W("System.Net.Requests"), {4, 0, 11, 0} }, \ + { _W("System.Net.Security"), {4, 0, 2, 0} }, \ + { _W("System.Net.Sockets"), {4, 2, 0, 0} }, \ + { _W("System.Net.WebHeaderCollection"), {4, 0, 1, 0} }, \ + { _W("System.Net.WebSockets"), {4, 0, 2, 0} }, \ + { _W("System.Net.WebSockets.Client"), {4, 0, 2, 0} }, \ + { _W("System.Numerics.Vectors"), {4, 1, 6, 0} }, \ + { _W("System.ObjectModel"), {4, 0, 11, 0} }, \ + { _W("System.Reflection"), {4, 1, 2, 0} }, \ + { _W("System.Reflection.Extensions"), {4, 0, 1, 0} }, \ + { _W("System.Reflection.Primitives"), {4, 0, 1, 0} }, \ + { _W("System.Resources.Reader"), {4, 0, 2, 0} }, \ + { _W("System.Resources.ResourceManager"), {4, 0, 1, 0} }, \ + { _W("System.Resources.Writer"), {4, 0, 2, 0} }, \ + { _W("System.Runtime"), {4, 1, 2, 0} }, \ + { _W("System.Runtime.CompilerServices.Unsafe"), {6, 0, 3, 0} }, \ + { _W("System.Runtime.CompilerServices.VisualC"), {4, 0, 2, 0} }, \ + { _W("System.Runtime.Extensions"), {4, 1, 2, 0} }, \ + { _W("System.Runtime.Handles"), {4, 0, 1, 0} }, \ + { _W("System.Runtime.InteropServices"), {4, 1, 2, 0} }, \ + { _W("System.Runtime.InteropServices.RuntimeInformation"), {4, 0, 2, 0} }, \ + { _W("System.Runtime.Numerics"), {4, 0, 1, 0} }, \ + { _W("System.Runtime.Serialization.Formatters"), {4, 0, 2, 0} }, \ + { _W("System.Runtime.Serialization.Json"), {4, 0, 1, 0} }, \ + { _W("System.Runtime.Serialization.Primitives"), {4, 2, 0, 0} }, \ + { _W("System.Runtime.Serialization.Xml"), {4, 1, 3, 0} }, \ + { _W("System.Security.Claims"), {4, 0, 3, 0} }, \ + { _W("System.Security.Cryptography.Algorithms"), {4, 3, 0, 0} }, \ + { _W("System.Security.Cryptography.Csp"), {4, 0, 2, 0} }, \ + { _W("System.Security.Cryptography.Encoding"), {4, 0, 2, 0} }, \ + { _W("System.Security.Cryptography.Primitives"), {4, 0, 2, 0} }, \ + { _W("System.Security.Cryptography.X509Certificates"), {4, 1, 2, 0} }, \ + { _W("System.Security.Principal"), {4, 0, 1, 0} }, \ + { _W("System.Security.SecureString"), {4, 1, 0, 0} }, \ + { _W("System.Text.Encoding"), {4, 0, 11, 0} }, \ + { _W("System.Text.Encoding.Extensions"), {4, 0, 11, 0} }, \ + { _W("System.Text.Encodings.Web"), {10, 0, 0, 2} }, \ + { _W("System.Text.Json"), {10, 0, 0, 2} }, \ + { _W("System.Text.RegularExpressions"), {4, 1, 1, 0} }, \ + { _W("System.Threading"), {4, 0, 11, 0} }, \ + { _W("System.Threading.Overlapped"), {4, 1, 0, 0} }, \ + { _W("System.Threading.Tasks"), {4, 0, 11, 0} }, \ + { _W("System.Threading.Tasks.Extensions"), {4, 2, 4, 0} }, \ + { _W("System.Threading.Tasks.Parallel"), {4, 0, 1, 0} }, \ + { _W("System.Threading.Thread"), {4, 0, 2, 0} }, \ + { _W("System.Threading.ThreadPool"), {4, 0, 12, 0} }, \ + { _W("System.Threading.Timer"), {4, 0, 1, 0} }, \ + { _W("System.ValueTuple"), {4, 0, 5, 0} }, \ + { _W("System.Xml.ReaderWriter"), {4, 1, 1, 0} }, \ + { _W("System.Xml.XDocument"), {4, 0, 11, 0} }, \ + { _W("System.Xml.XmlDocument"), {4, 0, 3, 0} }, \ + { _W("System.Xml.XmlSerializer"), {4, 0, 11, 0} }, \ + { _W("System.Xml.XPath"), {4, 0, 3, 0} }, \ + { _W("System.Xml.XPath.XDocument"), {4, 1, 0, 0} }, \ + }}, \ + { 470, { \ + { _W("Microsoft.Bcl.AsyncInterfaces"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration.Binder"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.DependencyInjection"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.DependencyInjection.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Diagnostics.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging.Configuration"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Options"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Options.ConfigurationExtensions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Primitives"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Win32.Primitives"), {4, 0, 3, 0} }, \ + { _W("OpenTelemetry"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api.ProviderBuilderExtensions"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation"), {auto_major, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Console"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.OpenTelemetryProtocol"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Prometheus.HttpListener"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Zipkin"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Extensions.Propagators"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Instrumentation.AspNet"), {1, 15, 1, 919} }, \ + { _W("OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule"), {1, 15, 1, 919} }, \ + { _W("OpenTelemetry.Instrumentation.GrpcNetClient"), {1, 15, 0, 896} }, \ + { _W("OpenTelemetry.Instrumentation.Http"), {1, 15, 0, 900} }, \ + { _W("OpenTelemetry.Instrumentation.Process"), {1, 15, 0, 892} }, \ + { _W("OpenTelemetry.Instrumentation.Quartz"), {1, 15, 0, 893} }, \ + { _W("OpenTelemetry.Instrumentation.Runtime"), {1, 15, 0, 899} }, \ + { _W("OpenTelemetry.Instrumentation.SqlClient"), {1, 15, 0, 918} }, \ + { _W("OpenTelemetry.Instrumentation.StackExchangeRedis"), {1, 15, 0, 903} }, \ + { _W("OpenTelemetry.Instrumentation.Wcf"), {1, 15, 0, 890} }, \ + { _W("OpenTelemetry.Resources.Azure"), {1, 15, 0, 889} }, \ + { _W("OpenTelemetry.Resources.Host"), {1, 15, 0, 917} }, \ + { _W("OpenTelemetry.Resources.OperatingSystem"), {1, 15, 0, 886} }, \ + { _W("OpenTelemetry.Resources.Process"), {1, 15, 0, 887} }, \ + { _W("OpenTelemetry.Resources.ProcessRuntime"), {1, 15, 0, 885} }, \ + { _W("OpenTelemetry.Shims.OpenTracing"), {1, 0, 0, 0} }, \ + { _W("OpenTracing"), {0, 12, 1, 0} }, \ + { _W("System.AppContext"), {4, 1, 2, 0} }, \ + { _W("System.Buffers"), {4, 0, 5, 0} }, \ + { _W("System.Collections"), {4, 0, 11, 0} }, \ + { _W("System.Collections.Concurrent"), {4, 0, 11, 0} }, \ + { _W("System.Collections.NonGeneric"), {4, 0, 3, 0} }, \ + { _W("System.Collections.Specialized"), {4, 0, 3, 0} }, \ + { _W("System.ComponentModel"), {4, 0, 1, 0} }, \ + { _W("System.ComponentModel.EventBasedAsync"), {4, 0, 11, 0} }, \ + { _W("System.ComponentModel.Primitives"), {4, 1, 2, 0} }, \ + { _W("System.ComponentModel.TypeConverter"), {4, 1, 2, 0} }, \ + { _W("System.Console"), {4, 0, 2, 0} }, \ + { _W("System.Data.Common"), {4, 2, 0, 0} }, \ + { _W("System.Diagnostics.Contracts"), {4, 0, 1, 0} }, \ + { _W("System.Diagnostics.Debug"), {4, 0, 11, 0} }, \ + { _W("System.Diagnostics.DiagnosticSource"), {10, 0, 0, 2} }, \ + { _W("System.Diagnostics.FileVersionInfo"), {4, 0, 2, 0} }, \ + { _W("System.Diagnostics.Process"), {4, 1, 2, 0} }, \ + { _W("System.Diagnostics.StackTrace"), {4, 1, 0, 0} }, \ + { _W("System.Diagnostics.TextWriterTraceListener"), {4, 0, 2, 0} }, \ + { _W("System.Diagnostics.Tools"), {4, 0, 1, 0} }, \ + { _W("System.Diagnostics.TraceSource"), {4, 0, 2, 0} }, \ + { _W("System.Diagnostics.Tracing"), {4, 2, 0, 0} }, \ + { _W("System.Drawing.Primitives"), {4, 0, 2, 0} }, \ + { _W("System.Dynamic.Runtime"), {4, 0, 11, 0} }, \ + { _W("System.Globalization"), {4, 0, 11, 0} }, \ + { _W("System.Globalization.Calendars"), {4, 0, 3, 0} }, \ + { _W("System.Globalization.Extensions"), {4, 1, 0, 0} }, \ + { _W("System.IO"), {4, 1, 2, 0} }, \ + { _W("System.IO.Compression"), {4, 2, 0, 0} }, \ + { _W("System.IO.Compression.ZipFile"), {4, 0, 3, 0} }, \ + { _W("System.IO.FileSystem"), {4, 0, 3, 0} }, \ + { _W("System.IO.FileSystem.DriveInfo"), {4, 0, 2, 0} }, \ + { _W("System.IO.FileSystem.Primitives"), {4, 0, 3, 0} }, \ + { _W("System.IO.FileSystem.Watcher"), {4, 0, 2, 0} }, \ + { _W("System.IO.IsolatedStorage"), {4, 0, 2, 0} }, \ + { _W("System.IO.MemoryMappedFiles"), {4, 0, 2, 0} }, \ + { _W("System.IO.Pipelines"), {10, 0, 0, 2} }, \ + { _W("System.IO.Pipes"), {4, 0, 2, 0} }, \ + { _W("System.IO.UnmanagedMemoryStream"), {4, 0, 3, 0} }, \ + { _W("System.Linq"), {4, 1, 2, 0} }, \ + { _W("System.Linq.Expressions"), {4, 1, 2, 0} }, \ + { _W("System.Linq.Parallel"), {4, 0, 1, 0} }, \ + { _W("System.Linq.Queryable"), {4, 0, 1, 0} }, \ + { _W("System.Memory"), {4, 0, 5, 0} }, \ + { _W("System.Net.Http"), {4, 2, 0, 0} }, \ + { _W("System.Net.NameResolution"), {4, 0, 2, 0} }, \ + { _W("System.Net.NetworkInformation"), {4, 1, 2, 0} }, \ + { _W("System.Net.Ping"), {4, 0, 2, 0} }, \ + { _W("System.Net.Primitives"), {4, 0, 11, 0} }, \ + { _W("System.Net.Requests"), {4, 0, 11, 0} }, \ + { _W("System.Net.Security"), {4, 0, 2, 0} }, \ + { _W("System.Net.Sockets"), {4, 2, 0, 0} }, \ + { _W("System.Net.WebHeaderCollection"), {4, 0, 1, 0} }, \ + { _W("System.Net.WebSockets"), {4, 0, 2, 0} }, \ + { _W("System.Net.WebSockets.Client"), {4, 0, 2, 0} }, \ + { _W("System.Numerics.Vectors"), {4, 1, 6, 0} }, \ + { _W("System.ObjectModel"), {4, 0, 11, 0} }, \ + { _W("System.Reflection"), {4, 1, 2, 0} }, \ + { _W("System.Reflection.Extensions"), {4, 0, 1, 0} }, \ + { _W("System.Reflection.Primitives"), {4, 0, 1, 0} }, \ + { _W("System.Resources.Reader"), {4, 0, 2, 0} }, \ + { _W("System.Resources.ResourceManager"), {4, 0, 1, 0} }, \ + { _W("System.Resources.Writer"), {4, 0, 2, 0} }, \ + { _W("System.Runtime"), {4, 1, 2, 0} }, \ + { _W("System.Runtime.CompilerServices.Unsafe"), {6, 0, 3, 0} }, \ + { _W("System.Runtime.CompilerServices.VisualC"), {4, 0, 2, 0} }, \ + { _W("System.Runtime.Extensions"), {4, 1, 2, 0} }, \ + { _W("System.Runtime.Handles"), {4, 0, 1, 0} }, \ + { _W("System.Runtime.InteropServices"), {4, 1, 2, 0} }, \ + { _W("System.Runtime.InteropServices.RuntimeInformation"), {4, 0, 2, 0} }, \ + { _W("System.Runtime.Numerics"), {4, 0, 1, 0} }, \ + { _W("System.Runtime.Serialization.Formatters"), {4, 0, 2, 0} }, \ + { _W("System.Runtime.Serialization.Json"), {4, 0, 1, 0} }, \ + { _W("System.Runtime.Serialization.Primitives"), {4, 2, 0, 0} }, \ + { _W("System.Runtime.Serialization.Xml"), {4, 1, 3, 0} }, \ + { _W("System.Security.Claims"), {4, 0, 3, 0} }, \ + { _W("System.Security.Cryptography.Algorithms"), {4, 3, 0, 0} }, \ + { _W("System.Security.Cryptography.Csp"), {4, 0, 2, 0} }, \ + { _W("System.Security.Cryptography.Encoding"), {4, 0, 2, 0} }, \ + { _W("System.Security.Cryptography.Primitives"), {4, 0, 2, 0} }, \ + { _W("System.Security.Cryptography.X509Certificates"), {4, 1, 2, 0} }, \ + { _W("System.Security.Principal"), {4, 0, 1, 0} }, \ + { _W("System.Security.SecureString"), {4, 1, 0, 0} }, \ + { _W("System.Text.Encoding"), {4, 0, 11, 0} }, \ + { _W("System.Text.Encoding.Extensions"), {4, 0, 11, 0} }, \ + { _W("System.Text.Encodings.Web"), {10, 0, 0, 2} }, \ + { _W("System.Text.Json"), {10, 0, 0, 2} }, \ + { _W("System.Text.RegularExpressions"), {4, 1, 1, 0} }, \ + { _W("System.Threading"), {4, 0, 11, 0} }, \ + { _W("System.Threading.Overlapped"), {4, 1, 0, 0} }, \ + { _W("System.Threading.Tasks"), {4, 0, 11, 0} }, \ + { _W("System.Threading.Tasks.Extensions"), {4, 2, 4, 0} }, \ + { _W("System.Threading.Tasks.Parallel"), {4, 0, 1, 0} }, \ + { _W("System.Threading.Thread"), {4, 0, 2, 0} }, \ + { _W("System.Threading.ThreadPool"), {4, 0, 12, 0} }, \ + { _W("System.Threading.Timer"), {4, 0, 1, 0} }, \ + { _W("System.ValueTuple"), {4, 0, 5, 0} }, \ + { _W("System.Xml.ReaderWriter"), {4, 1, 1, 0} }, \ + { _W("System.Xml.XDocument"), {4, 0, 11, 0} }, \ + { _W("System.Xml.XmlDocument"), {4, 0, 3, 0} }, \ + { _W("System.Xml.XmlSerializer"), {4, 0, 11, 0} }, \ + { _W("System.Xml.XPath"), {4, 0, 3, 0} }, \ + { _W("System.Xml.XPath.XDocument"), {4, 1, 0, 0} }, \ + }}, \ + { 471, { \ + { _W("Microsoft.Bcl.AsyncInterfaces"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration.Binder"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.DependencyInjection"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.DependencyInjection.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Diagnostics.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging.Configuration"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Options"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Options.ConfigurationExtensions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Primitives"), {10, 0, 0, 2} }, \ + { _W("OpenTelemetry"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api.ProviderBuilderExtensions"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation"), {auto_major, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Console"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.OpenTelemetryProtocol"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Prometheus.HttpListener"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Zipkin"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Extensions.Propagators"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Instrumentation.AspNet"), {1, 15, 1, 919} }, \ + { _W("OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule"), {1, 15, 1, 919} }, \ + { _W("OpenTelemetry.Instrumentation.GrpcNetClient"), {1, 15, 0, 896} }, \ + { _W("OpenTelemetry.Instrumentation.Http"), {1, 15, 0, 900} }, \ + { _W("OpenTelemetry.Instrumentation.Process"), {1, 15, 0, 892} }, \ + { _W("OpenTelemetry.Instrumentation.Quartz"), {1, 15, 0, 893} }, \ + { _W("OpenTelemetry.Instrumentation.Runtime"), {1, 15, 0, 899} }, \ + { _W("OpenTelemetry.Instrumentation.SqlClient"), {1, 15, 0, 918} }, \ + { _W("OpenTelemetry.Instrumentation.StackExchangeRedis"), {1, 15, 0, 903} }, \ + { _W("OpenTelemetry.Instrumentation.Wcf"), {1, 15, 0, 890} }, \ + { _W("OpenTelemetry.Resources.Azure"), {1, 15, 0, 889} }, \ + { _W("OpenTelemetry.Resources.Host"), {1, 15, 0, 917} }, \ + { _W("OpenTelemetry.Resources.OperatingSystem"), {1, 15, 0, 886} }, \ + { _W("OpenTelemetry.Resources.Process"), {1, 15, 0, 887} }, \ + { _W("OpenTelemetry.Resources.ProcessRuntime"), {1, 15, 0, 885} }, \ + { _W("OpenTelemetry.Shims.OpenTracing"), {1, 0, 0, 0} }, \ + { _W("OpenTracing"), {0, 12, 1, 0} }, \ + { _W("System.Buffers"), {4, 0, 5, 0} }, \ + { _W("System.Data.Common"), {4, 2, 0, 0} }, \ + { _W("System.Diagnostics.DiagnosticSource"), {10, 0, 0, 2} }, \ + { _W("System.Diagnostics.StackTrace"), {4, 1, 0, 0} }, \ + { _W("System.Diagnostics.Tracing"), {4, 2, 0, 0} }, \ + { _W("System.Globalization.Extensions"), {4, 1, 0, 0} }, \ + { _W("System.IO.Compression"), {4, 2, 0, 0} }, \ + { _W("System.IO.Pipelines"), {10, 0, 0, 2} }, \ + { _W("System.Memory"), {4, 0, 5, 0} }, \ + { _W("System.Net.Http"), {4, 2, 0, 0} }, \ + { _W("System.Net.Sockets"), {4, 2, 0, 0} }, \ + { _W("System.Numerics.Vectors"), {4, 1, 6, 0} }, \ + { _W("System.Runtime.CompilerServices.Unsafe"), {6, 0, 3, 0} }, \ + { _W("System.Runtime.Serialization.Primitives"), {4, 2, 0, 0} }, \ + { _W("System.Security.Cryptography.Algorithms"), {4, 3, 0, 0} }, \ + { _W("System.Security.SecureString"), {4, 1, 0, 0} }, \ + { _W("System.Text.Encodings.Web"), {10, 0, 0, 2} }, \ + { _W("System.Text.Json"), {10, 0, 0, 2} }, \ + { _W("System.Threading.Overlapped"), {4, 1, 0, 0} }, \ + { _W("System.Threading.Tasks.Extensions"), {4, 2, 4, 0} }, \ + { _W("System.Xml.XPath.XDocument"), {4, 1, 0, 0} }, \ + }}, \ + { 472, { \ + { _W("Microsoft.Bcl.AsyncInterfaces"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Configuration.Binder"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.DependencyInjection"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.DependencyInjection.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Diagnostics.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging.Abstractions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Logging.Configuration"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Options"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Options.ConfigurationExtensions"), {10, 0, 0, 2} }, \ + { _W("Microsoft.Extensions.Primitives"), {10, 0, 0, 2} }, \ + { _W("OpenTelemetry"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Api.ProviderBuilderExtensions"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.AutoInstrumentation"), {auto_major, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Console"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.OpenTelemetryProtocol"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Prometheus.HttpListener"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Exporter.Zipkin"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Extensions.Propagators"), {1, 0, 0, 0} }, \ + { _W("OpenTelemetry.Instrumentation.AspNet"), {1, 15, 1, 919} }, \ + { _W("OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule"), {1, 15, 1, 919} }, \ + { _W("OpenTelemetry.Instrumentation.GrpcNetClient"), {1, 15, 0, 896} }, \ + { _W("OpenTelemetry.Instrumentation.Http"), {1, 15, 0, 900} }, \ + { _W("OpenTelemetry.Instrumentation.Process"), {1, 15, 0, 892} }, \ + { _W("OpenTelemetry.Instrumentation.Quartz"), {1, 15, 0, 893} }, \ + { _W("OpenTelemetry.Instrumentation.Runtime"), {1, 15, 0, 899} }, \ + { _W("OpenTelemetry.Instrumentation.SqlClient"), {1, 15, 0, 918} }, \ + { _W("OpenTelemetry.Instrumentation.StackExchangeRedis"), {1, 15, 0, 903} }, \ + { _W("OpenTelemetry.Instrumentation.Wcf"), {1, 15, 0, 890} }, \ + { _W("OpenTelemetry.Resources.Azure"), {1, 15, 0, 889} }, \ + { _W("OpenTelemetry.Resources.Host"), {1, 15, 0, 917} }, \ + { _W("OpenTelemetry.Resources.OperatingSystem"), {1, 15, 0, 886} }, \ + { _W("OpenTelemetry.Resources.Process"), {1, 15, 0, 887} }, \ + { _W("OpenTelemetry.Resources.ProcessRuntime"), {1, 15, 0, 885} }, \ + { _W("OpenTelemetry.Shims.OpenTracing"), {1, 0, 0, 0} }, \ + { _W("OpenTracing"), {0, 12, 1, 0} }, \ + { _W("System.Buffers"), {4, 0, 5, 0} }, \ + { _W("System.Diagnostics.DiagnosticSource"), {10, 0, 0, 2} }, \ + { _W("System.IO.Pipelines"), {10, 0, 0, 2} }, \ + { _W("System.Memory"), {4, 0, 5, 0} }, \ + { _W("System.Numerics.Vectors"), {4, 1, 6, 0} }, \ + { _W("System.Runtime.CompilerServices.Unsafe"), {6, 0, 3, 0} }, \ + { _W("System.Text.Encodings.Web"), {10, 0, 0, 2} }, \ + { _W("System.Text.Json"), {10, 0, 0, 2} }, \ + { _W("System.Threading.Tasks.Extensions"), {4, 2, 4, 0} }, \ + }} diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.cpp b/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.cpp index a3dceccc32..c7c0a43e5c 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.cpp +++ b/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.cpp @@ -8,6 +8,7 @@ #include #include +#include "assembly_redirection.h" #include "clr_helpers.h" #include "dllmain.h" #include "environment_variables.h" @@ -38,10 +39,6 @@ #include #endif -#ifdef _WIN32 -#include "netfx_assembly_redirection.h" -#endif - #define FailProfiler(LEVEL, MESSAGE) \ Logger::LEVEL(MESSAGE); \ if (IsFailFastEnabled()) \ @@ -138,13 +135,11 @@ HRESULT STDMETHODCALLTYPE CorProfiler::Initialize(IUnknown* cor_profiler_info_un FailProfiler(Warn, "Failed to attach profiler: Not supported .NET version (lower than 6.0).") } -#ifdef _WIN32 - if (runtime_information_.is_desktop() && IsNetFxAssemblyRedirectionEnabled()) + if (IsAssemblyRedirectionEnabled()) { - InitNetFxAssemblyRedirectsMap(); + InitAssemblyRedirectsMap(); DetectFrameworkVersionTableForRedirectsMap(); } -#endif const auto& process_name = GetCurrentProcessName(); const auto& exclude_process_names = GetEnvironmentValues(environment::exclude_process_names); @@ -360,7 +355,6 @@ HRESULT STDMETHODCALLTYPE CorProfiler::AssemblyLoadFinished(AssemblyID assembly_ return S_OK; } -#ifdef _WIN32 void CorProfiler::RedirectAssemblyReferences(const ComPtr& assembly_import, const ComPtr& assembly_emit) { @@ -492,7 +486,6 @@ void CorProfiler::RedirectAssemblyReferences(const ComPtr metadata_interfaces; auto hr = this->info_->GetModuleMetaData(module_id, ofRead | ofWrite, IID_IMetaDataImport2, @@ -813,14 +801,14 @@ HRESULT STDMETHODCALLTYPE CorProfiler::ModuleLoadFinished(ModuleID module_id, HR ModuleMetadata(metadata_import, metadata_emit, assembly_import, assembly_emit, module_info.assembly.name, module_info.assembly.app_domain_id, &corAssemblyProperty); -#ifdef _WIN32 - if (perform_netfx_redirect) + if (perform_redirect) { - // On the .NET Framework redirect any assembly reference to the versions required by - // OpenTelemetry.AutoInstrumentation assembly, the ones under netfx/ folder. + // Redirect any assembly reference to the versions required by + // OpenTelemetry.AutoInstrumentation assembly: + // - for .NET Frameworks - the ones under netfx/ folder + // - for .NET (Core) - the ones under net/ folder RedirectAssemblyReferences(assembly_import, assembly_emit); } -#endif // _WIN32 if (module_info.assembly.name == managed_profiler_name) { @@ -3862,83 +3850,114 @@ HRESULT STDMETHODCALLTYPE CorProfiler::EventPipeEventDelivered(EVENTPIPE_PROVIDE return S_OK; } -#ifdef _WIN32 void CorProfiler::DetectFrameworkVersionTableForRedirectsMap() { - // Default to 4.6.2 (462) if detection fails - int frameworkVersion = 462; - - // Check for 4.7.2 first - // If we ever need to detect higher versions, we should use - // the registry method below directly (adding detection for 4.7.2 and up) - // or find another option - ICorProfilerInfo8* info8 = nullptr; - HRESULT hr = this->info_->QueryInterface(__uuidof(ICorProfilerInfo8), (void**)&info8); - if (SUCCEEDED(hr)) - { - info8->Release(); - info8 = nullptr; - frameworkVersion = 472; + int frameworkVersion = 0; - Logger::Debug("DetectFrameworkVersionTableForRedirectsMap: Detected .NET Framework 4.7.2 (ICorProfilerInfo8)"); - } - else + // TODO ugly ifdef to separate .NET Framework and .NET (Core) detection +#ifdef _WIN32 + if (runtime_information_.is_desktop()) { + // .NET Framework detection + // Default to 4.6.2 (462) if detection fails + frameworkVersion = 462; - HKEY hKey = nullptr; - LONG result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full\\", 0, - KEY_READ, &hKey); - - if (result != ERROR_SUCCESS) + // Check for 4.7.2 first + ICorProfilerInfo8* info8 = nullptr; + HRESULT hr = this->info_->QueryInterface(__uuidof(ICorProfilerInfo8), (void**)&info8); + if (SUCCEEDED(hr)) { - Logger::Warn("DetectFrameworkVersionTableForRedirectsMap: Failed to open registry key, using default " - "version 462"); + info8->Release(); + info8 = nullptr; + frameworkVersion = 472; + + Logger::Debug( + "DetectFrameworkVersionTableForRedirectsMap: Detected .NET Framework 4.7.2 (ICorProfilerInfo8)"); } else { - DWORD releaseValue = 0; - DWORD dataSize = sizeof(DWORD); - DWORD valueType = REG_DWORD; - - result = RegQueryValueExW(hKey, L"Release", nullptr, &valueType, reinterpret_cast(&releaseValue), - &dataSize); + HKEY hKey = nullptr; + LONG result = + RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full\\", 0, + KEY_READ, &hKey); - RegCloseKey(hKey); - - if (result != ERROR_SUCCESS || valueType != REG_DWORD) + if (result != ERROR_SUCCESS) { - Logger::Warn("DetectFrameworkVersionTableForRedirectsMap: Failed to read Release value, using " - "default version 462"); + Logger::Warn("DetectFrameworkVersionTableForRedirectsMap: Failed to open registry key, using default " + "version 462"); } else { - // Map release numbers to framework versions - // Based on Microsoft documentation: - // https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed - if (releaseValue >= 461308) - { - frameworkVersion = 471; // 4.7.1 - } - else if (releaseValue >= 460798) - { - frameworkVersion = 470; // 4.7 - } - else if (releaseValue >= 394802) + DWORD releaseValue = 0; + DWORD dataSize = sizeof(DWORD); + DWORD valueType = REG_DWORD; + + result = RegQueryValueExW(hKey, L"Release", nullptr, &valueType, + reinterpret_cast(&releaseValue), &dataSize); + + RegCloseKey(hKey); + + if (result != ERROR_SUCCESS || valueType != REG_DWORD) { - frameworkVersion = 462; // 4.6.2 + Logger::Warn("DetectFrameworkVersionTableForRedirectsMap: Failed to read Release value, using " + "default version 462"); } else { - Logger::Warn("DetectFrameworkVersionTableForRedirectsMap: Old .NET Framework detected, use 462 " - "as fallback"); + // Map release numbers to framework versions + // Based on Microsoft documentation: + // https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed + if (releaseValue >= 461308) + { + frameworkVersion = 471; // 4.7.1 + } + else if (releaseValue >= 460798) + { + frameworkVersion = 470; // 4.7 + } + else if (releaseValue >= 394802) + { + frameworkVersion = 462; // 4.6.2 + } + else + { + Logger::Warn("DetectFrameworkVersionTableForRedirectsMap: Old .NET Framework detected, use 462 " + "as fallback"); + } } + + Logger::Debug("DetectFrameworkVersionTableForRedirectsMap: Detected .NET Framework version ", + frameworkVersion, " (Release: ", releaseValue, ")"); } + } + } + else +#endif + { + // .NET (Core) detection + // Map major.minor version to framework version key to match generator: net8.0 -> 80, net9.0 -> 90, etc + int majorVersion = runtime_information_.major_version; + int minorVersion = runtime_information_.minor_version; - Logger::Debug("DetectFrameworkVersionTableForRedirectsMap: Detected .NET Framework version ", - frameworkVersion, " (Release: ", releaseValue, ")"); + if (majorVersion >= 6) + { + // Calculate key the same way as AssemblyRedirectionSourceGenerator: + frameworkVersion = (majorVersion * 10 + minorVersion); + + Logger::Debug("DetectFrameworkVersionTableForRedirectsMap: Detected .NET ", majorVersion, ".", minorVersion, + " (framework key: ", frameworkVersion, ")"); + } + else + { + // Default to .NET 8.0 if version detection fails or unsupported version + frameworkVersion = 80; + Logger::Warn("DetectFrameworkVersionTableForRedirectsMap: Unsupported or undetected .NET (Core) version ", + majorVersion, ".", minorVersion, ", using default version 80"); } } + // Find the best matching framework version in the map + // by selecting the highest available version that is <= detected version assembly_version_redirect_map_current_framework_key_ = 0; for (auto& [key, values] : assembly_version_redirect_map_) { @@ -3961,6 +3980,10 @@ void CorProfiler::DetectFrameworkVersionTableForRedirectsMap() } } +#ifdef _WIN32 +// even though this method looks at the current framework of redirection map +// which is supported on any platform, we only use this method for .NET Framework +// in Loader AssemblyResolver.NetFramework int CorProfiler::GetNetFrameworkRedirectionVersion() const { return assembly_version_redirect_map_current_framework_key_; diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.h b/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.h index 5bfd864032..f2586d0d72 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.h +++ b/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.h @@ -106,18 +106,6 @@ class CorProfiler : public CorProfilerBase // HRESULT STDMETHODCALLTYPE JITCompilationStartedOnNetFramework(FunctionID function_id, BOOL is_safe_to_block); - // - // Assembly redirect private members. - // - std::unordered_map> assembly_version_redirect_map_; - std::unordered_map* assembly_version_redirect_map_current_framework_; - int assembly_version_redirect_map_current_framework_key_ = 0; - - void InitNetFxAssemblyRedirectsMap(); - void RedirectAssemblyReferences( - const ComPtr& assembly_import, - const ComPtr& assembly_emit); - // // Loader methods. These are only used on the .NET Framework. // @@ -129,9 +117,20 @@ class CorProfiler : public CorProfilerBase mdMethodDef* patch_app_domain_setup_method); HRESULT ModifyAppDomainCreate(const ModuleID module_id, mdMethodDef patch_app_domain_setup_method); HRESULT AddIISPreStartInitFlags(const ModuleID module_id, const mdToken function_token); - void DetectFrameworkVersionTableForRedirectsMap(); #endif + // + // Assembly redirect private members. + // + std::unordered_map> assembly_version_redirect_map_; + std::unordered_map* assembly_version_redirect_map_current_framework_; + int assembly_version_redirect_map_current_framework_key_ = 0; + + void InitAssemblyRedirectsMap(); + void RedirectAssemblyReferences(const ComPtr& assembly_import, + const ComPtr& assembly_emit); + void DetectFrameworkVersionTableForRedirectsMap(); + // // Helper methods // diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables.h b/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables.h index 35d7d4ee74..086fd282d5 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables.h +++ b/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables.h @@ -63,8 +63,11 @@ const WSTRING clr_enable_inlining = WStr("OTEL_DOTNET_AUTO_CLR_ENABLE_INLINING") // Sets whether to enable NGEN images. const WSTRING clr_enable_ngen = WStr("OTEL_DOTNET_AUTO_CLR_ENABLE_NGEN"); -// Enable the assembly version redirection when running on the .NET Framework. -const WSTRING netfx_assembly_redirection_enabled = WStr("OTEL_DOTNET_AUTO_NETFX_REDIRECT_ENABLED"); +// Enable the assembly version redirection. +const WSTRING assembly_redirection_enabled = WStr("OTEL_DOTNET_AUTO_REDIRECT_ENABLED"); + +// (Legacy variable) Enable the assembly version redirection for .NET Framework assemblies. +const WSTRING assembly_redirection_enabled_netfx_legacy = WStr("OTEL_DOTNET_AUTO_NETFX_REDIRECT_ENABLED"); // Enable the fail fast mode. const WSTRING fail_fast_enabled = WStr("OTEL_DOTNET_AUTO_FAIL_FAST_ENABLED"); diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables_util.cpp b/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables_util.cpp index f6a6ae1155..e96ac7b1e8 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables_util.cpp +++ b/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables_util.cpp @@ -38,9 +38,20 @@ bool IsFailFastEnabled() CheckIfTrue(GetEnvironmentValue(environment::fail_fast_enabled)); } -bool IsNetFxAssemblyRedirectionEnabled() +bool IsAssemblyRedirectionEnabled() { - ToBooleanWithDefault(GetEnvironmentValue(environment::netfx_assembly_redirection_enabled), true); + auto assemblyRedirectEnvValue = GetEnvironmentValue(environment::assembly_redirection_enabled); + +#ifdef _WIN32 + // For .Net Framework if the primary variable is NOT set (neither True nor False), + // then we consider it "unset" and check the legacy fallback. + if (!TrueCondition(assemblyRedirectEnvValue) && !FalseCondition(assemblyRedirectEnvValue)) + { + assemblyRedirectEnvValue = GetEnvironmentValue(environment::assembly_redirection_enabled_netfx_legacy); + } +#endif + + ToBooleanWithDefault(assemblyRedirectEnvValue, true); } } // namespace trace \ No newline at end of file diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables_util.h b/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables_util.h index e34de45629..7b71a41db8 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables_util.h +++ b/src/OpenTelemetry.AutoInstrumentation.Native/environment_variables_util.h @@ -49,7 +49,7 @@ bool IsNGENEnabled(); bool IsDumpILRewriteEnabled(); bool IsAzureAppServices(); bool IsFailFastEnabled(); -bool IsNetFxAssemblyRedirectionEnabled(); +bool IsAssemblyRedirectionEnabled(); } // namespace trace diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/netfx_assembly_redirection.h b/src/OpenTelemetry.AutoInstrumentation.Native/netfx_assembly_redirection.h deleted file mode 100644 index 6d448abd7c..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.Native/netfx_assembly_redirection.h +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -// Auto-generated file, do not change it - generated by the AssemblyRedirectionSourceGenerator type - -#include "cor_profiler.h" - -#ifdef _WIN32 -#define STR(Z1) #Z1 -#define AUTO_MAJOR STR(OTEL_AUTO_VERSION_MAJOR) - -namespace trace -{ -void CorProfiler::InitNetFxAssemblyRedirectsMap() -{ - const USHORT auto_major = atoi(AUTO_MAJOR); - - assembly_version_redirect_map_.insert({ - { 462, { - { L"Microsoft.Bcl.AsyncInterfaces", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration.Binder", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.DependencyInjection", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.DependencyInjection.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Diagnostics.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging.Configuration", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Options", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Options.ConfigurationExtensions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Primitives", {10, 0, 0, 2} }, - { L"Microsoft.Win32.Primitives", {4, 0, 3, 0} }, - { L"OpenTelemetry", {1, 0, 0, 0} }, - { L"OpenTelemetry.Api", {1, 0, 0, 0} }, - { L"OpenTelemetry.Api.ProviderBuilderExtensions", {1, 0, 0, 0} }, - { L"OpenTelemetry.AutoInstrumentation", {auto_major, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Console", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.OpenTelemetryProtocol", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Prometheus.HttpListener", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Zipkin", {1, 0, 0, 0} }, - { L"OpenTelemetry.Extensions.Propagators", {1, 0, 0, 0} }, - { L"OpenTelemetry.Instrumentation.AspNet", {1, 15, 1, 919} }, - { L"OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule", {1, 15, 1, 919} }, - { L"OpenTelemetry.Instrumentation.GrpcNetClient", {1, 15, 0, 896} }, - { L"OpenTelemetry.Instrumentation.Http", {1, 15, 0, 900} }, - { L"OpenTelemetry.Instrumentation.Process", {1, 15, 0, 892} }, - { L"OpenTelemetry.Instrumentation.Quartz", {1, 15, 0, 893} }, - { L"OpenTelemetry.Instrumentation.Runtime", {1, 15, 0, 899} }, - { L"OpenTelemetry.Instrumentation.SqlClient", {1, 15, 0, 918} }, - { L"OpenTelemetry.Instrumentation.StackExchangeRedis", {1, 15, 0, 903} }, - { L"OpenTelemetry.Instrumentation.Wcf", {1, 15, 0, 890} }, - { L"OpenTelemetry.Resources.Azure", {1, 15, 0, 889} }, - { L"OpenTelemetry.Resources.Host", {1, 15, 0, 917} }, - { L"OpenTelemetry.Resources.OperatingSystem", {1, 15, 0, 886} }, - { L"OpenTelemetry.Resources.Process", {1, 15, 0, 887} }, - { L"OpenTelemetry.Resources.ProcessRuntime", {1, 15, 0, 885} }, - { L"OpenTelemetry.Shims.OpenTracing", {1, 0, 0, 0} }, - { L"OpenTracing", {0, 12, 1, 0} }, - { L"System.AppContext", {4, 1, 2, 0} }, - { L"System.Buffers", {4, 0, 5, 0} }, - { L"System.Collections", {4, 0, 11, 0} }, - { L"System.Collections.Concurrent", {4, 0, 11, 0} }, - { L"System.Collections.NonGeneric", {4, 0, 3, 0} }, - { L"System.Collections.Specialized", {4, 0, 3, 0} }, - { L"System.ComponentModel", {4, 0, 1, 0} }, - { L"System.ComponentModel.EventBasedAsync", {4, 0, 11, 0} }, - { L"System.ComponentModel.Primitives", {4, 1, 2, 0} }, - { L"System.ComponentModel.TypeConverter", {4, 1, 2, 0} }, - { L"System.Console", {4, 0, 2, 0} }, - { L"System.Data.Common", {4, 2, 0, 0} }, - { L"System.Diagnostics.Contracts", {4, 0, 1, 0} }, - { L"System.Diagnostics.Debug", {4, 0, 11, 0} }, - { L"System.Diagnostics.DiagnosticSource", {10, 0, 0, 2} }, - { L"System.Diagnostics.FileVersionInfo", {4, 0, 2, 0} }, - { L"System.Diagnostics.Process", {4, 1, 2, 0} }, - { L"System.Diagnostics.StackTrace", {4, 1, 0, 0} }, - { L"System.Diagnostics.TextWriterTraceListener", {4, 0, 2, 0} }, - { L"System.Diagnostics.Tools", {4, 0, 1, 0} }, - { L"System.Diagnostics.TraceSource", {4, 0, 2, 0} }, - { L"System.Diagnostics.Tracing", {4, 2, 0, 0} }, - { L"System.Drawing.Primitives", {4, 0, 2, 0} }, - { L"System.Dynamic.Runtime", {4, 0, 11, 0} }, - { L"System.Globalization", {4, 0, 11, 0} }, - { L"System.Globalization.Calendars", {4, 0, 3, 0} }, - { L"System.Globalization.Extensions", {4, 1, 0, 0} }, - { L"System.IO", {4, 1, 2, 0} }, - { L"System.IO.Compression", {4, 2, 0, 0} }, - { L"System.IO.Compression.ZipFile", {4, 0, 3, 0} }, - { L"System.IO.FileSystem", {4, 0, 3, 0} }, - { L"System.IO.FileSystem.DriveInfo", {4, 0, 2, 0} }, - { L"System.IO.FileSystem.Primitives", {4, 0, 3, 0} }, - { L"System.IO.FileSystem.Watcher", {4, 0, 2, 0} }, - { L"System.IO.IsolatedStorage", {4, 0, 2, 0} }, - { L"System.IO.MemoryMappedFiles", {4, 0, 2, 0} }, - { L"System.IO.Pipelines", {10, 0, 0, 2} }, - { L"System.IO.Pipes", {4, 0, 2, 0} }, - { L"System.IO.UnmanagedMemoryStream", {4, 0, 3, 0} }, - { L"System.Linq", {4, 1, 2, 0} }, - { L"System.Linq.Expressions", {4, 1, 2, 0} }, - { L"System.Linq.Parallel", {4, 0, 1, 0} }, - { L"System.Linq.Queryable", {4, 0, 1, 0} }, - { L"System.Memory", {4, 0, 5, 0} }, - { L"System.Net.Http", {4, 2, 0, 0} }, - { L"System.Net.NameResolution", {4, 0, 2, 0} }, - { L"System.Net.NetworkInformation", {4, 1, 2, 0} }, - { L"System.Net.Ping", {4, 0, 2, 0} }, - { L"System.Net.Primitives", {4, 0, 11, 0} }, - { L"System.Net.Requests", {4, 0, 11, 0} }, - { L"System.Net.Security", {4, 0, 2, 0} }, - { L"System.Net.Sockets", {4, 2, 0, 0} }, - { L"System.Net.WebHeaderCollection", {4, 0, 1, 0} }, - { L"System.Net.WebSockets", {4, 0, 2, 0} }, - { L"System.Net.WebSockets.Client", {4, 0, 2, 0} }, - { L"System.Numerics.Vectors", {4, 1, 6, 0} }, - { L"System.ObjectModel", {4, 0, 11, 0} }, - { L"System.Reflection", {4, 1, 2, 0} }, - { L"System.Reflection.Extensions", {4, 0, 1, 0} }, - { L"System.Reflection.Primitives", {4, 0, 1, 0} }, - { L"System.Resources.Reader", {4, 0, 2, 0} }, - { L"System.Resources.ResourceManager", {4, 0, 1, 0} }, - { L"System.Resources.Writer", {4, 0, 2, 0} }, - { L"System.Runtime", {4, 1, 2, 0} }, - { L"System.Runtime.CompilerServices.Unsafe", {6, 0, 3, 0} }, - { L"System.Runtime.CompilerServices.VisualC", {4, 0, 2, 0} }, - { L"System.Runtime.Extensions", {4, 1, 2, 0} }, - { L"System.Runtime.Handles", {4, 0, 1, 0} }, - { L"System.Runtime.InteropServices", {4, 1, 2, 0} }, - { L"System.Runtime.InteropServices.RuntimeInformation", {4, 0, 2, 0} }, - { L"System.Runtime.Numerics", {4, 0, 1, 0} }, - { L"System.Runtime.Serialization.Formatters", {4, 0, 2, 0} }, - { L"System.Runtime.Serialization.Json", {4, 0, 1, 0} }, - { L"System.Runtime.Serialization.Primitives", {4, 2, 0, 0} }, - { L"System.Runtime.Serialization.Xml", {4, 1, 3, 0} }, - { L"System.Security.Claims", {4, 0, 3, 0} }, - { L"System.Security.Cryptography.Algorithms", {4, 3, 0, 0} }, - { L"System.Security.Cryptography.Csp", {4, 0, 2, 0} }, - { L"System.Security.Cryptography.Encoding", {4, 0, 2, 0} }, - { L"System.Security.Cryptography.Primitives", {4, 0, 2, 0} }, - { L"System.Security.Cryptography.X509Certificates", {4, 1, 2, 0} }, - { L"System.Security.Principal", {4, 0, 1, 0} }, - { L"System.Security.SecureString", {4, 1, 0, 0} }, - { L"System.Text.Encoding", {4, 0, 11, 0} }, - { L"System.Text.Encoding.Extensions", {4, 0, 11, 0} }, - { L"System.Text.Encodings.Web", {10, 0, 0, 2} }, - { L"System.Text.Json", {10, 0, 0, 2} }, - { L"System.Text.RegularExpressions", {4, 1, 1, 0} }, - { L"System.Threading", {4, 0, 11, 0} }, - { L"System.Threading.Overlapped", {4, 1, 0, 0} }, - { L"System.Threading.Tasks", {4, 0, 11, 0} }, - { L"System.Threading.Tasks.Extensions", {4, 2, 4, 0} }, - { L"System.Threading.Tasks.Parallel", {4, 0, 1, 0} }, - { L"System.Threading.Thread", {4, 0, 2, 0} }, - { L"System.Threading.ThreadPool", {4, 0, 12, 0} }, - { L"System.Threading.Timer", {4, 0, 1, 0} }, - { L"System.ValueTuple", {4, 0, 5, 0} }, - { L"System.Xml.ReaderWriter", {4, 1, 1, 0} }, - { L"System.Xml.XDocument", {4, 0, 11, 0} }, - { L"System.Xml.XmlDocument", {4, 0, 3, 0} }, - { L"System.Xml.XmlSerializer", {4, 0, 11, 0} }, - { L"System.Xml.XPath", {4, 0, 3, 0} }, - { L"System.Xml.XPath.XDocument", {4, 1, 0, 0} }, - }}, - { 470, { - { L"Microsoft.Bcl.AsyncInterfaces", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration.Binder", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.DependencyInjection", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.DependencyInjection.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Diagnostics.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging.Configuration", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Options", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Options.ConfigurationExtensions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Primitives", {10, 0, 0, 2} }, - { L"Microsoft.Win32.Primitives", {4, 0, 3, 0} }, - { L"OpenTelemetry", {1, 0, 0, 0} }, - { L"OpenTelemetry.Api", {1, 0, 0, 0} }, - { L"OpenTelemetry.Api.ProviderBuilderExtensions", {1, 0, 0, 0} }, - { L"OpenTelemetry.AutoInstrumentation", {auto_major, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Console", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.OpenTelemetryProtocol", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Prometheus.HttpListener", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Zipkin", {1, 0, 0, 0} }, - { L"OpenTelemetry.Extensions.Propagators", {1, 0, 0, 0} }, - { L"OpenTelemetry.Instrumentation.AspNet", {1, 15, 1, 919} }, - { L"OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule", {1, 15, 1, 919} }, - { L"OpenTelemetry.Instrumentation.GrpcNetClient", {1, 15, 0, 896} }, - { L"OpenTelemetry.Instrumentation.Http", {1, 15, 0, 900} }, - { L"OpenTelemetry.Instrumentation.Process", {1, 15, 0, 892} }, - { L"OpenTelemetry.Instrumentation.Quartz", {1, 15, 0, 893} }, - { L"OpenTelemetry.Instrumentation.Runtime", {1, 15, 0, 899} }, - { L"OpenTelemetry.Instrumentation.SqlClient", {1, 15, 0, 918} }, - { L"OpenTelemetry.Instrumentation.StackExchangeRedis", {1, 15, 0, 903} }, - { L"OpenTelemetry.Instrumentation.Wcf", {1, 15, 0, 890} }, - { L"OpenTelemetry.Resources.Azure", {1, 15, 0, 889} }, - { L"OpenTelemetry.Resources.Host", {1, 15, 0, 917} }, - { L"OpenTelemetry.Resources.OperatingSystem", {1, 15, 0, 886} }, - { L"OpenTelemetry.Resources.Process", {1, 15, 0, 887} }, - { L"OpenTelemetry.Resources.ProcessRuntime", {1, 15, 0, 885} }, - { L"OpenTelemetry.Shims.OpenTracing", {1, 0, 0, 0} }, - { L"OpenTracing", {0, 12, 1, 0} }, - { L"System.AppContext", {4, 1, 2, 0} }, - { L"System.Buffers", {4, 0, 5, 0} }, - { L"System.Collections", {4, 0, 11, 0} }, - { L"System.Collections.Concurrent", {4, 0, 11, 0} }, - { L"System.Collections.NonGeneric", {4, 0, 3, 0} }, - { L"System.Collections.Specialized", {4, 0, 3, 0} }, - { L"System.ComponentModel", {4, 0, 1, 0} }, - { L"System.ComponentModel.EventBasedAsync", {4, 0, 11, 0} }, - { L"System.ComponentModel.Primitives", {4, 1, 2, 0} }, - { L"System.ComponentModel.TypeConverter", {4, 1, 2, 0} }, - { L"System.Console", {4, 0, 2, 0} }, - { L"System.Data.Common", {4, 2, 0, 0} }, - { L"System.Diagnostics.Contracts", {4, 0, 1, 0} }, - { L"System.Diagnostics.Debug", {4, 0, 11, 0} }, - { L"System.Diagnostics.DiagnosticSource", {10, 0, 0, 2} }, - { L"System.Diagnostics.FileVersionInfo", {4, 0, 2, 0} }, - { L"System.Diagnostics.Process", {4, 1, 2, 0} }, - { L"System.Diagnostics.StackTrace", {4, 1, 0, 0} }, - { L"System.Diagnostics.TextWriterTraceListener", {4, 0, 2, 0} }, - { L"System.Diagnostics.Tools", {4, 0, 1, 0} }, - { L"System.Diagnostics.TraceSource", {4, 0, 2, 0} }, - { L"System.Diagnostics.Tracing", {4, 2, 0, 0} }, - { L"System.Drawing.Primitives", {4, 0, 2, 0} }, - { L"System.Dynamic.Runtime", {4, 0, 11, 0} }, - { L"System.Globalization", {4, 0, 11, 0} }, - { L"System.Globalization.Calendars", {4, 0, 3, 0} }, - { L"System.Globalization.Extensions", {4, 1, 0, 0} }, - { L"System.IO", {4, 1, 2, 0} }, - { L"System.IO.Compression", {4, 2, 0, 0} }, - { L"System.IO.Compression.ZipFile", {4, 0, 3, 0} }, - { L"System.IO.FileSystem", {4, 0, 3, 0} }, - { L"System.IO.FileSystem.DriveInfo", {4, 0, 2, 0} }, - { L"System.IO.FileSystem.Primitives", {4, 0, 3, 0} }, - { L"System.IO.FileSystem.Watcher", {4, 0, 2, 0} }, - { L"System.IO.IsolatedStorage", {4, 0, 2, 0} }, - { L"System.IO.MemoryMappedFiles", {4, 0, 2, 0} }, - { L"System.IO.Pipelines", {10, 0, 0, 2} }, - { L"System.IO.Pipes", {4, 0, 2, 0} }, - { L"System.IO.UnmanagedMemoryStream", {4, 0, 3, 0} }, - { L"System.Linq", {4, 1, 2, 0} }, - { L"System.Linq.Expressions", {4, 1, 2, 0} }, - { L"System.Linq.Parallel", {4, 0, 1, 0} }, - { L"System.Linq.Queryable", {4, 0, 1, 0} }, - { L"System.Memory", {4, 0, 5, 0} }, - { L"System.Net.Http", {4, 2, 0, 0} }, - { L"System.Net.NameResolution", {4, 0, 2, 0} }, - { L"System.Net.NetworkInformation", {4, 1, 2, 0} }, - { L"System.Net.Ping", {4, 0, 2, 0} }, - { L"System.Net.Primitives", {4, 0, 11, 0} }, - { L"System.Net.Requests", {4, 0, 11, 0} }, - { L"System.Net.Security", {4, 0, 2, 0} }, - { L"System.Net.Sockets", {4, 2, 0, 0} }, - { L"System.Net.WebHeaderCollection", {4, 0, 1, 0} }, - { L"System.Net.WebSockets", {4, 0, 2, 0} }, - { L"System.Net.WebSockets.Client", {4, 0, 2, 0} }, - { L"System.Numerics.Vectors", {4, 1, 6, 0} }, - { L"System.ObjectModel", {4, 0, 11, 0} }, - { L"System.Reflection", {4, 1, 2, 0} }, - { L"System.Reflection.Extensions", {4, 0, 1, 0} }, - { L"System.Reflection.Primitives", {4, 0, 1, 0} }, - { L"System.Resources.Reader", {4, 0, 2, 0} }, - { L"System.Resources.ResourceManager", {4, 0, 1, 0} }, - { L"System.Resources.Writer", {4, 0, 2, 0} }, - { L"System.Runtime", {4, 1, 2, 0} }, - { L"System.Runtime.CompilerServices.Unsafe", {6, 0, 3, 0} }, - { L"System.Runtime.CompilerServices.VisualC", {4, 0, 2, 0} }, - { L"System.Runtime.Extensions", {4, 1, 2, 0} }, - { L"System.Runtime.Handles", {4, 0, 1, 0} }, - { L"System.Runtime.InteropServices", {4, 1, 2, 0} }, - { L"System.Runtime.InteropServices.RuntimeInformation", {4, 0, 2, 0} }, - { L"System.Runtime.Numerics", {4, 0, 1, 0} }, - { L"System.Runtime.Serialization.Formatters", {4, 0, 2, 0} }, - { L"System.Runtime.Serialization.Json", {4, 0, 1, 0} }, - { L"System.Runtime.Serialization.Primitives", {4, 2, 0, 0} }, - { L"System.Runtime.Serialization.Xml", {4, 1, 3, 0} }, - { L"System.Security.Claims", {4, 0, 3, 0} }, - { L"System.Security.Cryptography.Algorithms", {4, 3, 0, 0} }, - { L"System.Security.Cryptography.Csp", {4, 0, 2, 0} }, - { L"System.Security.Cryptography.Encoding", {4, 0, 2, 0} }, - { L"System.Security.Cryptography.Primitives", {4, 0, 2, 0} }, - { L"System.Security.Cryptography.X509Certificates", {4, 1, 2, 0} }, - { L"System.Security.Principal", {4, 0, 1, 0} }, - { L"System.Security.SecureString", {4, 1, 0, 0} }, - { L"System.Text.Encoding", {4, 0, 11, 0} }, - { L"System.Text.Encoding.Extensions", {4, 0, 11, 0} }, - { L"System.Text.Encodings.Web", {10, 0, 0, 2} }, - { L"System.Text.Json", {10, 0, 0, 2} }, - { L"System.Text.RegularExpressions", {4, 1, 1, 0} }, - { L"System.Threading", {4, 0, 11, 0} }, - { L"System.Threading.Overlapped", {4, 1, 0, 0} }, - { L"System.Threading.Tasks", {4, 0, 11, 0} }, - { L"System.Threading.Tasks.Extensions", {4, 2, 4, 0} }, - { L"System.Threading.Tasks.Parallel", {4, 0, 1, 0} }, - { L"System.Threading.Thread", {4, 0, 2, 0} }, - { L"System.Threading.ThreadPool", {4, 0, 12, 0} }, - { L"System.Threading.Timer", {4, 0, 1, 0} }, - { L"System.ValueTuple", {4, 0, 5, 0} }, - { L"System.Xml.ReaderWriter", {4, 1, 1, 0} }, - { L"System.Xml.XDocument", {4, 0, 11, 0} }, - { L"System.Xml.XmlDocument", {4, 0, 3, 0} }, - { L"System.Xml.XmlSerializer", {4, 0, 11, 0} }, - { L"System.Xml.XPath", {4, 0, 3, 0} }, - { L"System.Xml.XPath.XDocument", {4, 1, 0, 0} }, - }}, - { 471, { - { L"Microsoft.Bcl.AsyncInterfaces", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration.Binder", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.DependencyInjection", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.DependencyInjection.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Diagnostics.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging.Configuration", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Options", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Options.ConfigurationExtensions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Primitives", {10, 0, 0, 2} }, - { L"OpenTelemetry", {1, 0, 0, 0} }, - { L"OpenTelemetry.Api", {1, 0, 0, 0} }, - { L"OpenTelemetry.Api.ProviderBuilderExtensions", {1, 0, 0, 0} }, - { L"OpenTelemetry.AutoInstrumentation", {auto_major, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Console", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.OpenTelemetryProtocol", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Prometheus.HttpListener", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Zipkin", {1, 0, 0, 0} }, - { L"OpenTelemetry.Extensions.Propagators", {1, 0, 0, 0} }, - { L"OpenTelemetry.Instrumentation.AspNet", {1, 15, 1, 919} }, - { L"OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule", {1, 15, 1, 919} }, - { L"OpenTelemetry.Instrumentation.GrpcNetClient", {1, 15, 0, 896} }, - { L"OpenTelemetry.Instrumentation.Http", {1, 15, 0, 900} }, - { L"OpenTelemetry.Instrumentation.Process", {1, 15, 0, 892} }, - { L"OpenTelemetry.Instrumentation.Quartz", {1, 15, 0, 893} }, - { L"OpenTelemetry.Instrumentation.Runtime", {1, 15, 0, 899} }, - { L"OpenTelemetry.Instrumentation.SqlClient", {1, 15, 0, 918} }, - { L"OpenTelemetry.Instrumentation.StackExchangeRedis", {1, 15, 0, 903} }, - { L"OpenTelemetry.Instrumentation.Wcf", {1, 15, 0, 890} }, - { L"OpenTelemetry.Resources.Azure", {1, 15, 0, 889} }, - { L"OpenTelemetry.Resources.Host", {1, 15, 0, 917} }, - { L"OpenTelemetry.Resources.OperatingSystem", {1, 15, 0, 886} }, - { L"OpenTelemetry.Resources.Process", {1, 15, 0, 887} }, - { L"OpenTelemetry.Resources.ProcessRuntime", {1, 15, 0, 885} }, - { L"OpenTelemetry.Shims.OpenTracing", {1, 0, 0, 0} }, - { L"OpenTracing", {0, 12, 1, 0} }, - { L"System.Buffers", {4, 0, 5, 0} }, - { L"System.Data.Common", {4, 2, 0, 0} }, - { L"System.Diagnostics.DiagnosticSource", {10, 0, 0, 2} }, - { L"System.Diagnostics.StackTrace", {4, 1, 0, 0} }, - { L"System.Diagnostics.Tracing", {4, 2, 0, 0} }, - { L"System.Globalization.Extensions", {4, 1, 0, 0} }, - { L"System.IO.Compression", {4, 2, 0, 0} }, - { L"System.IO.Pipelines", {10, 0, 0, 2} }, - { L"System.Memory", {4, 0, 5, 0} }, - { L"System.Net.Http", {4, 2, 0, 0} }, - { L"System.Net.Sockets", {4, 2, 0, 0} }, - { L"System.Numerics.Vectors", {4, 1, 6, 0} }, - { L"System.Runtime.CompilerServices.Unsafe", {6, 0, 3, 0} }, - { L"System.Runtime.Serialization.Primitives", {4, 2, 0, 0} }, - { L"System.Security.Cryptography.Algorithms", {4, 3, 0, 0} }, - { L"System.Security.SecureString", {4, 1, 0, 0} }, - { L"System.Text.Encodings.Web", {10, 0, 0, 2} }, - { L"System.Text.Json", {10, 0, 0, 2} }, - { L"System.Threading.Overlapped", {4, 1, 0, 0} }, - { L"System.Threading.Tasks.Extensions", {4, 2, 4, 0} }, - { L"System.Xml.XPath.XDocument", {4, 1, 0, 0} }, - }}, - { 472, { - { L"Microsoft.Bcl.AsyncInterfaces", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Configuration.Binder", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.DependencyInjection", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.DependencyInjection.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Diagnostics.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging.Abstractions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Logging.Configuration", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Options", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Options.ConfigurationExtensions", {10, 0, 0, 2} }, - { L"Microsoft.Extensions.Primitives", {10, 0, 0, 2} }, - { L"OpenTelemetry", {1, 0, 0, 0} }, - { L"OpenTelemetry.Api", {1, 0, 0, 0} }, - { L"OpenTelemetry.Api.ProviderBuilderExtensions", {1, 0, 0, 0} }, - { L"OpenTelemetry.AutoInstrumentation", {auto_major, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Console", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.OpenTelemetryProtocol", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Prometheus.HttpListener", {1, 0, 0, 0} }, - { L"OpenTelemetry.Exporter.Zipkin", {1, 0, 0, 0} }, - { L"OpenTelemetry.Extensions.Propagators", {1, 0, 0, 0} }, - { L"OpenTelemetry.Instrumentation.AspNet", {1, 15, 1, 919} }, - { L"OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule", {1, 15, 1, 919} }, - { L"OpenTelemetry.Instrumentation.GrpcNetClient", {1, 15, 0, 896} }, - { L"OpenTelemetry.Instrumentation.Http", {1, 15, 0, 900} }, - { L"OpenTelemetry.Instrumentation.Process", {1, 15, 0, 892} }, - { L"OpenTelemetry.Instrumentation.Quartz", {1, 15, 0, 893} }, - { L"OpenTelemetry.Instrumentation.Runtime", {1, 15, 0, 899} }, - { L"OpenTelemetry.Instrumentation.SqlClient", {1, 15, 0, 918} }, - { L"OpenTelemetry.Instrumentation.StackExchangeRedis", {1, 15, 0, 903} }, - { L"OpenTelemetry.Instrumentation.Wcf", {1, 15, 0, 890} }, - { L"OpenTelemetry.Resources.Azure", {1, 15, 0, 889} }, - { L"OpenTelemetry.Resources.Host", {1, 15, 0, 917} }, - { L"OpenTelemetry.Resources.OperatingSystem", {1, 15, 0, 886} }, - { L"OpenTelemetry.Resources.Process", {1, 15, 0, 887} }, - { L"OpenTelemetry.Resources.ProcessRuntime", {1, 15, 0, 885} }, - { L"OpenTelemetry.Shims.OpenTracing", {1, 0, 0, 0} }, - { L"OpenTracing", {0, 12, 1, 0} }, - { L"System.Buffers", {4, 0, 5, 0} }, - { L"System.Diagnostics.DiagnosticSource", {10, 0, 0, 2} }, - { L"System.IO.Pipelines", {10, 0, 0, 2} }, - { L"System.Memory", {4, 0, 5, 0} }, - { L"System.Numerics.Vectors", {4, 1, 6, 0} }, - { L"System.Runtime.CompilerServices.Unsafe", {6, 0, 3, 0} }, - { L"System.Text.Encodings.Web", {10, 0, 0, 2} }, - { L"System.Text.Json", {10, 0, 0, 2} }, - { L"System.Threading.Tasks.Extensions", {4, 2, 4, 0} }, - }} - }); -} -} -#endif diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/IsolatedAssemblyLoadContext.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/IsolatedAssemblyLoadContext.cs new file mode 100644 index 0000000000..5f571eaedd --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/IsolatedAssemblyLoadContext.cs @@ -0,0 +1,89 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +using System.Reflection; +using System.Runtime.Loader; +using OpenTelemetry.AutoInstrumentation.Util; + +namespace OpenTelemetry.AutoInstrumentation; + +/// +/// Custom AssemblyLoadContext for isolated mode. +/// Loads both customer and agent assemblies, picking higher versions. +/// +internal class IsolatedAssemblyLoadContext() + : AssemblyLoadContext("OpenTelemetry.AutoInstrumentation.IsolatedAssemblyLoadContext", isCollectible: false) +{ + // TODO we may want to define variables for Exlude and Include list (exclude supplements to default excludes, includes overrides) + // TODO which will give flexibility for the customer if they know what they are doing; + // TODO also we can automtically add to excludes, if an assembly failed to load in custom ALC so we won't fail it over and over + private static readonly HashSet MustUseDefaultAlc = new(StringComparer.OrdinalIgnoreCase) { "System.Private.CoreLib" }; + + private readonly Dictionary _tpaAssemblies = ParseTrustedPlatformAssemblies(); + + protected override Assembly? Load(AssemblyName assemblyName) + { + // TODO: temporary no logging here! Logging triggers assembly loads -> infinite recursion. + + var name = assemblyName.Name; + if (string.IsNullOrEmpty(name) || MustUseDefaultAlc.Contains(name)) + { + return null; + } + + // Already loaded in this context? + // Return any loaded assembly with matching name, regardless of version + // (we enforce single version per name in this context) + var cached = Assemblies.FirstOrDefault(a => a.GetName().Name == name); + if (cached != null) + { + return cached; + } + + // Find in TPA (customer/runtime assemblies) + _tpaAssemblies.TryGetValue(name, out var tpaPath); + + // Find in agent assemblies + var managedProfilerPath = ManagedProfilerLocationHelper.GetAssemblyPath(name); + + // Pick higher version (agent wins only if strictly higher) + var selected = PickHigherVersion(tpaPath, managedProfilerPath); + + return selected != null ? LoadFromAssemblyPath(selected) : null; + } + + private static Dictionary ParseTrustedPlatformAssemblies() + { + return TrustedPlatformAssembliesHelper.TpaPaths + .Select(path => new { Name = Path.GetFileNameWithoutExtension(path), Path = path }) + .Where(x => !string.IsNullOrEmpty(x.Name)) + .DistinctBy(x => x.Name, StringComparer.OrdinalIgnoreCase) + .ToDictionary(x => x.Name, x => x.Path, StringComparer.OrdinalIgnoreCase); + } + + private static string? PickHigherVersion(string? tpaPath, string? managedProfilerPath) + { + if (managedProfilerPath == null) + { + return tpaPath; + } + + if (tpaPath == null) + { + return managedProfilerPath; + } + + try + { + var tpaVersion = AssemblyName.GetAssemblyName(tpaPath).Version; + var agentVersion = AssemblyName.GetAssemblyName(managedProfilerPath).Version; + + // Agent wins ONLY if strictly higher + return agentVersion > tpaVersion ? managedProfilerPath : tpaPath; + } + catch + { + return tpaPath; // On error, prefer TPA + } + } +} diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/IsolatedAssemblyResolver.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/IsolatedAssemblyResolver.cs new file mode 100644 index 0000000000..ebb4ca36fc --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/IsolatedAssemblyResolver.cs @@ -0,0 +1,85 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +using System.Reflection; +using System.Runtime.Loader; +using OpenTelemetry.AutoInstrumentation.Logging; +using OpenTelemetry.AutoInstrumentation.Util; + +namespace OpenTelemetry.AutoInstrumentation; + +/// +/// Provides assembly resolution for StartupHook-only deployment (no native profiler). +/// Creates an isolated AssemblyLoadContext that loads both customer and agent assemblies, +/// +internal sealed class IsolatedAssemblyResolver(string targetAppPath, Assembly? originalEntryAssembly, IOtelLogger logger) : IDisposable +{ + private AssemblyLoadContext.ContextualReflectionScope? _contextualReflectionScope; + private Assembly? _isolatedEntryAssembly; + private IsolatedAssemblyLoadContext? _isolatedContext; + + /// + /// Sets up an isolated AssemblyLoadContext, initializes instrumentation, + /// and executes the customer application entrypoint. + /// + /// The exit code from the customer's Main method, or 0 if void. + public int Run() + { + logger.Debug($"Isolation mode - Target app path: {targetAppPath}"); + logger.Debug($"Isolation mode - Target entry assembly: {originalEntryAssembly}"); + + // 1. Create isolated context + _isolatedContext = new IsolatedAssemblyLoadContext(); + logger.Debug("Created isolated AssemblyLoadContext"); + + // 2. Enable contextual reflection (helps with Assembly.Load(string), Type.GetType) + _contextualReflectionScope = _isolatedContext.EnterContextualReflection(); + logger.Debug("Contextual Reflection is set to isolated context"); + + // 3. Load customer entry assembly into isolated context + _isolatedEntryAssembly = _isolatedContext.LoadFromAssemblyPath(targetAppPath); + logger.Debug($"Loaded target entry assembly to isolated context: {_isolatedEntryAssembly.FullName}"); + + // 4. Initialize instrumentation loader (contextual reflection is active) + var loaderAssembly = Assembly.Load(StartupHook.LoaderAssemblyName) + ?? throw new InvalidOperationException("Failed to load Loader"); + _ = loaderAssembly.CreateInstance(StartupHook.LoaderTypeName) + ?? throw new InvalidOperationException("Failed to create an instance of the Loader"); + + // 5. Set entry assembly for frameworks and third-party that depends on it + Assembly.SetEntryAssembly(_isolatedEntryAssembly); + logger.Debug("Set entry assembly to target assembly loaded in isolated context"); + + // 6. Execute customer entrypoint + var entryPoint = _isolatedEntryAssembly.EntryPoint + ?? throw new InvalidOperationException("Entry assembly has no entrypoint"); + + var args = Environment.GetCommandLineArgs().Skip(1).ToArray(); + var parameters = entryPoint.GetParameters().Length > 0 ? new object[] { args } : null; + + return entryPoint.Invoke(null, parameters) as int? ?? 0; + } + + /// + /// Reverts the isolation setup. Called automatically if an exception occurs during setup + /// (before customer entrypoint is invoked), allowing the runtime to fall back to normal execution. + /// + public void Dispose() + { + // Revert contextual reflection + _contextualReflectionScope?.Dispose(); + + // Restore original entry assembly + if (originalEntryAssembly != null) + { + try + { + Assembly.SetEntryAssembly(originalEntryAssembly); + } + catch + { + // Best effort - may fail if runtime state has changed + } + } + } +} diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/OpenTelemetry.AutoInstrumentation.StartupHook.csproj b/src/OpenTelemetry.AutoInstrumentation.StartupHook/OpenTelemetry.AutoInstrumentation.StartupHook.csproj index 498ab1b74b..2202ec06d5 100644 --- a/src/OpenTelemetry.AutoInstrumentation.StartupHook/OpenTelemetry.AutoInstrumentation.StartupHook.csproj +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/OpenTelemetry.AutoInstrumentation.StartupHook.csproj @@ -5,13 +5,13 @@ this project should target netcoreapp3.1. Reference: https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/1644 --> netcoreapp3.1 + 14.0 StartupHook used by the OpenTelemetry.AutoInstrumentation project. $(NoWarn);CA1031 - Logging\InternalLogger.cs @@ -69,6 +69,15 @@ Configurations\ConfigurationKeys.FailFast.cs + + + + diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/AssemblyFileVersionRule.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/AssemblyFileVersionRule.cs index f1b4d08513..5c2b52235d 100644 --- a/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/AssemblyFileVersionRule.cs +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/AssemblyFileVersionRule.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Text.Json; using OpenTelemetry.AutoInstrumentation.Logging; +using OpenTelemetry.AutoInstrumentation.Util; namespace OpenTelemetry.AutoInstrumentation.RulesEngine; @@ -43,8 +44,14 @@ internal override bool Evaluate() { var autoInstrumentationFileVersion = new Version(ruleFileInfo.FileVersion); - var appInstrumentationAssembly = Assembly.Load(referencedAssembly); - var appInstrumentationFileVersionInfo = FileVersionInfo.GetVersionInfo(appInstrumentationAssembly.Location); + var appInstrumentationAssemblyPath = TrustedPlatformAssembliesHelper.TpaPaths.FirstOrDefault(path => Path.GetFileNameWithoutExtension(path).Equals(referencedAssembly.Name, StringComparison.OrdinalIgnoreCase)); + if (appInstrumentationAssemblyPath == null) + { + Logger.Warning($"Rule Engine: Could not find assembly {ruleFileInfo.FileName} in TPA list. Skipping file version validation for this assembly."); + continue; + } + + var appInstrumentationFileVersionInfo = FileVersionInfo.GetVersionInfo(appInstrumentationAssemblyPath); var appInstrumentationFileVersion = new Version(appInstrumentationFileVersionInfo.FileVersion); if (appInstrumentationFileVersion < autoInstrumentationFileVersion) diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/OpenTelemetrySdkMinimumVersionRule.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/OpenTelemetrySdkMinimumVersionRule.cs index 3104dbf4db..19cf7f70b0 100644 --- a/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/OpenTelemetrySdkMinimumVersionRule.cs +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/OpenTelemetrySdkMinimumVersionRule.cs @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 using System.Diagnostics; -using System.Reflection; using OpenTelemetry.AutoInstrumentation.Logging; +using OpenTelemetry.AutoInstrumentation.Util; namespace OpenTelemetry.AutoInstrumentation.RulesEngine; internal class OpenTelemetrySdkMinimumVersionRule : Rule { + private const string OpenTelemetryAssemblyFileName = "OpenTelemetry.dll"; private static IOtelLogger logger = OtelLogging.GetLogger("StartupHook"); public OpenTelemetrySdkMinimumVersionRule() @@ -26,8 +27,6 @@ protected OpenTelemetrySdkMinimumVersionRule(IOtelLogger otelLogger) internal override bool Evaluate() { - string? oTelPackageVersion = null; - try { var loadedOTelFileVersion = GetVersionFromApp(); @@ -36,7 +35,8 @@ internal override bool Evaluate() var autoInstrumentationOTelFileVersion = GetVersionFromAutoInstrumentation(); if (loadedOTelFileVersion < autoInstrumentationOTelFileVersion) { - oTelPackageVersion = loadedOTelFileVersion.ToString(); + logger.Error($"Rule Engine: Application has direct or indirect reference to older version of OpenTelemetry package {loadedOTelFileVersion}."); + return false; } } } @@ -47,26 +47,19 @@ internal override bool Evaluate() return true; } - if (oTelPackageVersion != null) - { - logger.Error($"Rule Engine: Application has direct or indirect reference to older version of OpenTelemetry package {oTelPackageVersion}."); - return false; - } - logger.Information("Rule Engine: OpenTelemetrySdkMinimumVersionRule evaluation success."); return true; } protected virtual Version? GetVersionFromApp() { - var openTelemetryType = Type.GetType("OpenTelemetry.Sdk, OpenTelemetry"); - if (openTelemetryType != null) + // if customer application has reference to OpenTelemetry SDK, we can get the file from TPA list + var openTelemetryLocation = TrustedPlatformAssembliesHelper.TpaPaths.FirstOrDefault(path => Path.GetFileName(path).Equals(OpenTelemetryAssemblyFileName, StringComparison.OrdinalIgnoreCase)); + if (openTelemetryLocation != null) { - var loadedOTelAssembly = Assembly.GetAssembly(openTelemetryType); - var loadedOTelFileVersionInfo = FileVersionInfo.GetVersionInfo(loadedOTelAssembly?.Location); - var loadedOTelFileVersion = new Version(loadedOTelFileVersionInfo.FileVersion); - - return loadedOTelFileVersion; + var openTelemetryFileVersionInfo = FileVersionInfo.GetVersionInfo(openTelemetryLocation); + var openTelemetryFileVersion = new Version(openTelemetryFileVersionInfo.FileVersion); + return openTelemetryFileVersion; } return null; @@ -74,10 +67,10 @@ internal override bool Evaluate() protected virtual Version? GetVersionFromAutoInstrumentation() { - var autoInstrumentationOTelLocation = Path.Combine(StartupHook.LoaderAssemblyLocation ?? string.Empty, "OpenTelemetry.dll"); - var autoInstrumentationOTelFileVersionInfo = FileVersionInfo.GetVersionInfo(autoInstrumentationOTelLocation); - var autoInstrumentationOTelFileVersion = new Version(autoInstrumentationOTelFileVersionInfo.FileVersion); + var openTelemetryLocation = Path.Combine(StartupHook.LoaderAssemblyLocation ?? string.Empty, OpenTelemetryAssemblyFileName); + var openTelemetryFileVersionInfo = FileVersionInfo.GetVersionInfo(openTelemetryLocation); + var openTelemetryFileVersion = new Version(openTelemetryFileVersionInfo.FileVersion); - return autoInstrumentationOTelFileVersion; + return openTelemetryFileVersion; } } diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/RuleEngine.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/RuleEngine.cs index 9c61c4e875..09e62648ac 100644 --- a/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/RuleEngine.cs +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/RuleEngine.cs @@ -82,7 +82,6 @@ private static List CreateDefaultOptionalRules() { return new() { - new RuntimeStoreDiagnosticRule(), new OpenTelemetrySdkMinimumVersionRule(), new AssemblyFileVersionRule(), new NativeProfilerDiagnosticsRule() diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/RuntimeStoreDiagnosticRule.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/RuntimeStoreDiagnosticRule.cs deleted file mode 100644 index 6556acce8c..0000000000 --- a/src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/RuntimeStoreDiagnosticRule.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -using System.Diagnostics; -using System.Reflection; -using System.Runtime.InteropServices; -using OpenTelemetry.AutoInstrumentation.Logging; - -namespace OpenTelemetry.AutoInstrumentation.RulesEngine; - -internal class RuntimeStoreDiagnosticRule : Rule -{ - private const string RuntimeStoreEnvironmentVariable = "DOTNET_SHARED_STORE"; - private static readonly IOtelLogger Logger = OtelLogging.GetLogger("StartupHook"); - - public RuntimeStoreDiagnosticRule() - { - Name = "Runtime Store Diagnostic Rule"; - Description = "Logs detail that assembly versions in the runtime store are not lower than the version the Application uses."; - } - - internal override bool Evaluate() - { - try - { - // Skip rule evaluation if the application is running in self-contained mode. - if (IsSelfContained()) - { - Logger.Debug("Rule Engine: Skipping rule evaluation for self-contained application."); - return true; - } - - var configuredStoreDirectory = GetConfiguredStoreDirectory(); - if (configuredStoreDirectory == null) - { - // Store location not found, skip rule evaluation - Logger.Debug("Rule Engine: Skipping rule evaluation as runtime store location is not found."); - return true; - } - - var storeFiles = Directory.GetFiles(configuredStoreDirectory, "Microsoft.Extensions*.dll", SearchOption.AllDirectories); - - foreach (var file in storeFiles) - { - var assemblyName = Path.GetFileNameWithoutExtension(file); - Assembly appInstrumentationAssembly; - - try - { - appInstrumentationAssembly = Assembly.Load(assemblyName); - } - catch (Exception ex) - { - Logger.Warning(ex, $"Rule Engine: Assembly load failed. Skipping rule evaluation for assembly - {assemblyName}"); - continue; - } - - var appInstrumentationFileVersionInfo = FileVersionInfo.GetVersionInfo(appInstrumentationAssembly.Location); - var appInstrumentationFileVersion = new Version(appInstrumentationFileVersionInfo.FileVersion); - - if (appInstrumentationFileVersion.Major < 5) - { - // Special case to handle runtime store version 3.1.x.x package references in app. - // Skip rule evaluation for assemblies with version 3.1.x.x. - Logger.Debug( - "Rule Engine: Skipping rule evaluation for runtime store assembly {0} with version {1}.", - appInstrumentationFileVersionInfo.FileName, - appInstrumentationFileVersion); - continue; - } - - var runTimeStoreFileVersionInfo = FileVersionInfo.GetVersionInfo(file); - var runTimeStoreFileVersion = new Version(runTimeStoreFileVersionInfo.FileVersion); - - if (appInstrumentationFileVersion < runTimeStoreFileVersion) - { - Logger.Warning($"Rule Engine: Application has direct or indirect reference to lower version of runtime store assembly {runTimeStoreFileVersionInfo.FileName} - {appInstrumentationFileVersion}. "); - } - else - { - Logger.Debug( - "Rule Engine: Runtime store assembly {0} is validated successfully.", - runTimeStoreFileVersionInfo.FileName); - } - } - } - catch (Exception ex) - { - // Exception in rule evaluation should not impact the result of the rule. - Logger.Warning(ex, "Rule Engine: Couldn't evaluate reference to runtime store assemblies in an app."); - } - - // This a diagnostic rule, so we always return true. - return true; - } - - private static string? GetConfiguredStoreDirectory() - { - try - { - var storeDirectory = Environment.GetEnvironmentVariable(RuntimeStoreEnvironmentVariable); - // Skip rule evaluation if the store directory is not configured. - if (storeDirectory == null) - { - Logger.Debug($"Rule Engine: {RuntimeStoreEnvironmentVariable} environment variable not found. Skipping rule evaluation."); - return null; - } - - // Check if the store directory exists - if (!Directory.Exists(storeDirectory)) - { - Logger.Debug( - "Rule Engine: Runtime store directory not found at {0}. Skipping rule evaluation.", - storeDirectory); - return null; - } - - var architecture = RuntimeInformation.ProcessArchitecture switch - { - Architecture.X86 => "x86", - Architecture.Arm64 => "arm64", - _ => "x64" // Default to x64 for architectures not explicitly handled - }; - - var targetFramework = $"net{Environment.Version.Major}.{Environment.Version.Minor}"; - var finalPath = Path.Combine(storeDirectory, architecture, targetFramework); - - return finalPath; - } - catch (Exception ex) - { - Logger.Warning(ex, "Error getting store directory location"); - throw; - } - } - - private static bool IsSelfContained() - { - var assemblyPath = Assembly.GetExecutingAssembly().Location; - var directory = Path.GetDirectoryName(assemblyPath); - - // Check for the presence of a known .NET runtime file - if (directory != null && - (File.Exists(Path.Combine(directory, "coreclr.dll")) || - File.Exists(Path.Combine(directory, "libcoreclr.so")) || - File.Exists(Path.Combine(directory, "libcoreclr.dylib")))) - { - return true; - } - - return false; - } -} diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/StartupHook.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/StartupHook.cs index 6a2b380908..268ffe1c65 100644 --- a/src/OpenTelemetry.AutoInstrumentation.StartupHook/StartupHook.cs +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/StartupHook.cs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 using System.Reflection; +using OpenTelemetry.AutoInstrumentation; using OpenTelemetry.AutoInstrumentation.Configurations; using OpenTelemetry.AutoInstrumentation.Logging; using OpenTelemetry.AutoInstrumentation.RulesEngine; @@ -11,6 +12,9 @@ /// internal class StartupHook { + internal const string LoaderAssemblyName = "OpenTelemetry.AutoInstrumentation.Loader"; + internal const string LoaderTypeName = "OpenTelemetry.AutoInstrumentation.Loader.Loader"; + private const string StartuphookLoggerSuffix = "StartupHook"; private static readonly IOtelLogger Logger = OtelLogging.GetLogger(StartuphookLoggerSuffix); @@ -38,22 +42,57 @@ public static void Initialize() Logger.Information("Initialization."); - // Creating an instance of OpenTelemetry.AutoInstrumentation.Loader.Startup - // will initialize Instrumentation through its static constructor. - var loaderFilePath = Path.Combine(LoaderAssemblyLocation, "OpenTelemetry.AutoInstrumentation.Loader.dll"); - var loaderAssembly = Assembly.LoadFrom(loaderFilePath); - var loaderInstance = loaderAssembly.CreateInstance("OpenTelemetry.AutoInstrumentation.Loader.Loader"); - if (loaderInstance is null) + if (IsStartupHookOnlyMode()) { - if (failFast) + // ASSEMBLY RESOLUTION STRATEGY + // + // === STARTUP HOOK ONLY === + // Lacks: + // - Native profiler's IL rewriting capabilities + // - Build-time version resolution (when deployed as NuGet package) + // This means customer aseembly and its dependencies load to Default ALC automatically. + // We cannot override versions in Default ALC or prevent customer dependencies from loading there. + // Loading our dependencies to a separate custom ALC risks shared state drift + // (e.g., ActivitySpan from DiagnosticSource). + // Solution: Hijack customer application, load it into custom ALC, execute it there + // alongside our dependencies, then exit to prevent runtime from re-executing it in Default ALC. + // If setup fails, cleanup and let it run normally (or fail fast if configured). + + // ASSEMBLY RESOLUTION TIMING + // + // When customer assembly loads into a custom ALC, all its dependencies + // go through the custom context's Load() method first (before Default ALC fallback). + // This is our single control point for version resolution. + + Logger.Information("Starting isolated AssemblyLoadContext mode"); + GetTargetApp(out var targetAppPath, out var entryAssembly); + using var resolver = new IsolatedAssemblyResolver(targetAppPath, entryAssembly, Logger); + try { - throw new InvalidOperationException("StartupHook failed to create an instance of the Loader"); + var exitCode = resolver.Run(); + Environment.Exit(exitCode); } + catch (TargetInvocationException ex) + { + Logger.Error(ex.InnerException ?? ex, "Target entrypoint threw exception"); + Environment.Exit(-1); + } + + // Other exceptions: the using statement cleans up and reverts to the Default ALC. + // The exception then propagates to Initialize()'s catch block, where failFast controls the behavior: + // - If failFast = true: exception is re-thrown (fail fast) + // - If failFast = false: exception is suppressed, and control returns to the .NET runtime + // to execute the customer's entrypoint normally (graceful degradation) } - else - { - Logger.Information("StartupHook initialized successfully!"); - } + + // If we run normally with Native profiler, we load the Loader, + // create an instance of OpenTelemetry.AutoInstrumentation.Loader.Loader + // which will setup assembly resolution and initialize Instrumentation + var loaderFilePath = Path.Combine(LoaderAssemblyLocation, $"{LoaderAssemblyName}.dll"); + var loaderAssembly = Assembly.LoadFrom(loaderFilePath) + ?? throw new InvalidOperationException("Failed to load Loader assembly"); + var loaderInstance = loaderAssembly.CreateInstance(LoaderTypeName) + ?? throw new InvalidOperationException("Failed to create an instance of the Loader"); } catch (Exception ex) { @@ -69,6 +108,39 @@ public static void Initialize() } } + private static bool IsStartupHookOnlyMode() + { + return Environment.GetEnvironmentVariable(Constants.EnvironmentVariables.ProfilerEnabledVariable) != "1"; + } + + private static void GetTargetApp(out string appPath, out Assembly? entryAssembly) + { + // Try entry assembly first (should already be loaded in Default ALC) + entryAssembly = Assembly.GetEntryAssembly(); + if (!string.IsNullOrEmpty(entryAssembly?.Location)) + { + appPath = entryAssembly.Location; + return; + } + + // Fallback: try command line args + Logger.Warning("Entry assembly location is unavailable, falling back to command line parsing. This may indicate an unexpected runtime scenario."); + + var args = Environment.GetCommandLineArgs(); + if (args.Length > 0 && + (args[0].EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || + args[0].EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) && + File.Exists(args[0])) + { + appPath = Path.GetFullPath(args[0]); + return; + } + + throw new InvalidOperationException( + "Cannot determine target application path. " + + "GetEntryAssembly().Location is empty and GetCommandLineArgs()[0] is not a valid assembly."); + } + private static string GetLoaderAssemblyLocation() { try @@ -77,17 +149,17 @@ private static string GetLoaderAssemblyLocation() if (startupAssemblyFilePath.StartsWith(@"\\?\", StringComparison.Ordinal)) { // This will only be used in case the local path exceeds max_path size limit - startupAssemblyFilePath = startupAssemblyFilePath.Substring(4); + startupAssemblyFilePath = startupAssemblyFilePath[4..]; } // StartupHook and Loader assemblies are in the same path - var startupAssemblyDirectoryPath = Path.GetDirectoryName(startupAssemblyFilePath) ?? - throw new InvalidOperationException("StartupAssemblyFilePath is NULL"); + var startupAssemblyDirectoryPath = Path.GetDirectoryName(startupAssemblyFilePath) + ?? throw new InvalidOperationException("StartupAssemblyFilePath is NULL"); return startupAssemblyDirectoryPath; } catch (Exception ex) { - Logger.Error($"Error getting loader directory location: {ex}"); + Logger.Error(ex, "Error getting loader directory location"); throw; } } diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/Util/AssemblyExtensions.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/Util/AssemblyExtensions.cs new file mode 100644 index 0000000000..9768cac61c --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/Util/AssemblyExtensions.cs @@ -0,0 +1,36 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +#if !NET9_0_OR_GREATER + +using System.Reflection; + +namespace OpenTelemetry.AutoInstrumentation.Util; + +/// +/// Provides SetEntryAssembly for frameworks before .NET 9. +/// On .NET 9+ the public API exists, so this is excluded. +/// Delete this file when the project targets .NET9+. +/// +internal static class AssemblyExtensions +{ + extension(Assembly) + { + public static void SetEntryAssembly(Assembly assembly) + { + SetEntryAssemblyDelegate?.Invoke(assembly); + } + } + + // Note: On .NET 8 SetEntryAssembly is non-public, but on .NET 9+ it becomes public. + // We search for both NonPublic and Public because this code runs on all frameworks + // until we stop building the Loader for .NET 8 only. + // Note 2: Keep this field below extension method to satisfy StyleCop SA1201 + // that doesn't yet recognize C# 14 extension blocks after field declaration. + private static readonly Action? SetEntryAssemblyDelegate = + typeof(Assembly) + .GetMethod("SetEntryAssembly", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static, null, [typeof(Assembly)], null) + ?.CreateDelegate>(); +} + +#endif diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/Util/EnumerableExtensions.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/Util/EnumerableExtensions.cs new file mode 100644 index 0000000000..e241b4d8a3 --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/Util/EnumerableExtensions.cs @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +#if !NET6_0_OR_GREATER + +namespace OpenTelemetry.AutoInstrumentation.Util; + +/// +/// Provides DistinctBy for frameworks before .NET 6. +/// On .NET 6+ the built-in LINQ DistinctBy exists, so this is excluded. +/// Delete this file when the project targets .NET6+. +/// +internal static class EnumerableExtensions +{ + public static IEnumerable DistinctBy( + this IEnumerable source, + Func keySelector, + IEqualityComparer? comparer = null) + { + var seen = new HashSet(comparer); + foreach (var element in source) + { + if (seen.Add(keySelector(element))) + { + yield return element; + } + } + } +} + +#endif diff --git a/src/OpenTelemetry.AutoInstrumentation.StartupHook/Util/MethodInfoExtensions.cs b/src/OpenTelemetry.AutoInstrumentation.StartupHook/Util/MethodInfoExtensions.cs new file mode 100644 index 0000000000..9522ffab31 --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation.StartupHook/Util/MethodInfoExtensions.cs @@ -0,0 +1,28 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +#if !NET6_0_OR_GREATER + +using System.Reflection; + +namespace OpenTelemetry.AutoInstrumentation.Util; + +/// +/// Provides CreateDelegate<T> polyfill for frameworks before .NET 6. +/// On .NET 6+ the generic CreateDelegate exists, so this is excluded. +/// Delete this file when the project targets .NET6+. +/// +internal static class MethodInfoExtensions +{ + /// + /// Creates a delegate of the specified type from this method. + /// Polyfill for the generic CreateDelegate<T> that doesn't exist in netcoreapp3.1. + /// + public static T? CreateDelegate(this MethodInfo methodInfo) + where T : Delegate + { + return (T?)methodInfo.CreateDelegate(typeof(T)); + } +} + +#endif diff --git a/src/OpenTelemetry.AutoInstrumentation/Constants.cs b/src/OpenTelemetry.AutoInstrumentation/Constants.cs index a88c11dd22..d4cd06ceb5 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Constants.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Constants.cs @@ -79,11 +79,18 @@ public static class Loggers public static class EnvironmentVariables { + // Profiler related environment variables public const string ProfilerEnabledVariable = "CORECLR_ENABLE_PROFILING"; public const string ProfilerIdVariable = "CORECLR_PROFILER"; public const string ProfilerPathVariable = "CORECLR_PROFILER_PATH"; public const string Profiler32BitPathVariable = "CORECLR_PROFILER_PATH_32"; public const string Profiler64BitPathVariable = "CORECLR_PROFILER_PATH_64"; public const string ProfilerId = "{918728DD-259F-4A6A-AC2B-B85E1B658318}"; + + // OpenTelemetry environment variables + public const string OtelDotnetAutoHome = "OTEL_DOTNET_AUTO_HOME"; + + // Trausted Platform Assemblies environment variables + public const string TrustedPlatformAssemblies = "TRUSTED_PLATFORM_ASSEMBLIES"; } } diff --git a/src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj b/src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj index 6db6501b73..3a98e5e5e9 100644 --- a/src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj +++ b/src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj @@ -25,6 +25,23 @@ + + + + + + + + + + + + + + + + + diff --git a/src/OpenTelemetry.AutoInstrumentation/Util/ManagedProfilerLocationHelper.Net.cs b/src/OpenTelemetry.AutoInstrumentation/Util/ManagedProfilerLocationHelper.Net.cs new file mode 100644 index 0000000000..58ac12316f --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation/Util/ManagedProfilerLocationHelper.Net.cs @@ -0,0 +1,34 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +using OpenTelemetry.AutoInstrumentation.Logging; + +namespace OpenTelemetry.AutoInstrumentation.Util; + +internal static partial class ManagedProfilerLocationHelper +{ + public static string ManagedProfilerRuntimeDirectory { get; } = Path.Combine(TracerHomeDirectory!, "net"); + + public static string ResolveManagedProfilerVersionDirectory(IOtelLogger? logger = null) + { + var commonLanguageRuntimeVersionDirectory = $"net{Environment.Version.Major}.{Environment.Version.Minor}"; + + logger?.Debug($"Using .NET folder: {commonLanguageRuntimeVersionDirectory}"); + + return Path.Combine(ManagedProfilerRuntimeDirectory, commonLanguageRuntimeVersionDirectory); + } + + public static string? GetAssemblyPath(string assemblyName, IOtelLogger? logger = null) + { + var runtimeDir = ManagedProfilerRuntimeDirectory; + LazyInitializer.EnsureInitialized(ref _managedProfilerVersionDirectory, () => ResolveManagedProfilerVersionDirectory(logger)); + + // For .NET (Core) most of the assembblies are different per runtime version, so we + // 1. first start with runtime version folder (e.g., tracer-home/net/net8.0) + // 2. then check .link file in runtime version folder + // 3. last fallback to runtime root folder (tracer-home/net) + return Probe(_managedProfilerVersionDirectory, assemblyName) ?? + CheckLinkFile(_managedProfilerVersionDirectory, runtimeDir, assemblyName, logger) ?? + Probe(runtimeDir, assemblyName); + } +} diff --git a/src/OpenTelemetry.AutoInstrumentation/Util/ManagedProfilerLocationHelper.NetFramework.cs b/src/OpenTelemetry.AutoInstrumentation/Util/ManagedProfilerLocationHelper.NetFramework.cs new file mode 100644 index 0000000000..8c3b09c88d --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation/Util/ManagedProfilerLocationHelper.NetFramework.cs @@ -0,0 +1,59 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +using System.Runtime.InteropServices; +using OpenTelemetry.AutoInstrumentation.Logging; + +namespace OpenTelemetry.AutoInstrumentation.Util; + +internal static partial class ManagedProfilerLocationHelper +{ + public static string ManagedProfilerRuntimeDirectory { get; } = Path.Combine(TracerHomeDirectory, "netfx"); + + public static string ResolveManagedProfilerVersionDirectory(IOtelLogger logger) + { + var frameworkDirectoryName = "net462"; + + try + { + var detectedVersion = GetNetFrameworkRedirectionVersion(); + var detectedDirectoryName = detectedVersion % 10 != 0 ? $"net{detectedVersion}" : $"net{detectedVersion / 10}"; + + if (Directory.Exists(Path.Combine(ManagedProfilerRuntimeDirectory, detectedDirectoryName))) + { + frameworkDirectoryName = detectedDirectoryName; + } + else + { + logger.Warning($"Framework folder {detectedDirectoryName} not found. Fallback to {frameworkDirectoryName}."); + } + } + catch (Exception ex) + { + logger.Warning(ex, $"Error getting .NET Framework version from native profiler. Fallback to {frameworkDirectoryName}."); + } + + logger.Debug($"Using .NET Framework folder: {frameworkDirectoryName}"); + + return Path.Combine(ManagedProfilerRuntimeDirectory, frameworkDirectoryName); + } + + public static string? GetAssemblyPath(string assemblyName, IOtelLogger logger) + { + var runtimeDir = ManagedProfilerRuntimeDirectory; + LazyInitializer.EnsureInitialized(ref _managedProfilerVersionDirectory, () => ResolveManagedProfilerVersionDirectory(logger)); + + // Framework Order: 1. RuntimeDir -> 2. VersionDir -> 3. Link (in VersionDir) + // For .NET Framework most of the assembblies are common, so we + // 3. first start with runtime root folder (tracer-home/netfx) + // 1. then check runtime version folder (e.g., tracer-home/netfx/net462) + // 2. last fallback to .link file in runtime version folder + return Probe(runtimeDir, assemblyName) ?? + Probe(_managedProfilerVersionDirectory!, assemblyName) ?? + CheckLinkFile(_managedProfilerVersionDirectory!, runtimeDir, assemblyName, logger); + } + + [DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")] + [DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)] + private static extern int GetNetFrameworkRedirectionVersion(); +} diff --git a/src/OpenTelemetry.AutoInstrumentation/Util/ManagedProfilerLocationHelper.cs b/src/OpenTelemetry.AutoInstrumentation/Util/ManagedProfilerLocationHelper.cs new file mode 100644 index 0000000000..a8f3ebe67a --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation/Util/ManagedProfilerLocationHelper.cs @@ -0,0 +1,59 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +using OpenTelemetry.AutoInstrumentation.Logging; + +namespace OpenTelemetry.AutoInstrumentation.Util; + +internal static partial class ManagedProfilerLocationHelper +{ + private static string? _managedProfilerVersionDirectory; + + public static string TracerHomeDirectory { get; } = + ReadEnvironmentVariable(Constants.EnvironmentVariables.OtelDotnetAutoHome) ?? string.Empty; + + private static string? ReadEnvironmentVariable(string key) + { + try + { + return Environment.GetEnvironmentVariable(key); + } + catch + { + return null; + } + } + + private static string? Probe(string dir, string name) + { + var path = Path.Combine(dir, $"{name}.dll"); + return File.Exists(path) ? path : null; + } + + private static string? CheckLinkFile(string versionDir, string runtimeDir, string name, IOtelLogger? logger = null) + { + var linkFile = Path.Combine(versionDir, $"{name}.dll.link"); + if (File.Exists(linkFile)) + { + try + { + var targetDirName = File.ReadAllText(linkFile).Trim(); + var targetDirPath = Path.Combine(runtimeDir, targetDirName); + var path = Probe(targetDirPath, name); + if (path == null) + { + logger?.Error($"Linked assembly path \"{Path.Combine(targetDirPath, $"{name}.dll")}\" does not exist"); + return null; + } + + return path; + } + catch (Exception ex) + { + logger?.Debug(ex, "Error reading .link file {0}", linkFile); + } + } + + return null; + } +} diff --git a/src/OpenTelemetry.AutoInstrumentation/Util/TrustedPlatformAssembliesHelper.Net.cs b/src/OpenTelemetry.AutoInstrumentation/Util/TrustedPlatformAssembliesHelper.Net.cs new file mode 100644 index 0000000000..b7f6023819 --- /dev/null +++ b/src/OpenTelemetry.AutoInstrumentation/Util/TrustedPlatformAssembliesHelper.Net.cs @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +namespace OpenTelemetry.AutoInstrumentation.Util; + +/// +/// Provides access to the Trusted Platform Assemblies (TPA) list. +/// The TPA list is parsed once during static initialization. +/// +internal static class TrustedPlatformAssembliesHelper +{ + /// + /// Gets the array of TPA paths. This value is computed once during type initialization. + /// + public static string[] TpaPaths { get; } = ParseTpaPaths(); + + private static string[] ParseTpaPaths() + { + try + { + return (AppContext.GetData(Constants.EnvironmentVariables.TrustedPlatformAssemblies) as string)? + .Split(Path.PathSeparator) + .Where(path => !string.IsNullOrWhiteSpace(path)) + .ToArray() ?? []; + } + catch + { + return []; + } + } +} diff --git a/test/IntegrationTests/BuildTests.DistributionStructure_alpine-linux-arm64.verified.txt b/test/IntegrationTests/BuildTests.DistributionStructure_alpine-linux-arm64.verified.txt index 9f8801848a..c7239f8074 100644 --- a/test/IntegrationTests/BuildTests.DistributionStructure_alpine-linux-arm64.verified.txt +++ b/test/IntegrationTests/BuildTests.DistributionStructure_alpine-linux-arm64.verified.txt @@ -1,14 +1,9 @@ [ - /AdditionalDeps/shared/Microsoft.NETCore.App/10.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/8.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/9.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, /LICENSE, /VERSION, /instrument.sh, /linux-musl-arm64/OpenTelemetry.AutoInstrumentation.Native.so, /linux-musl-arm64/OpenTelemetry.AutoInstrumentation.Native.so.debug, - /net/OpenTelemetry.Api.ProviderBuilderExtensions.dll, - /net/OpenTelemetry.Api.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.pdb, /net/OpenTelemetry.AutoInstrumentation.Loader.dll, @@ -17,68 +12,123 @@ /net/OpenTelemetry.AutoInstrumentation.StartupHook.pdb, /net/OpenTelemetry.AutoInstrumentation.dll, /net/OpenTelemetry.AutoInstrumentation.pdb, - /net/OpenTelemetry.Exporter.Console.dll, - /net/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, - /net/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, - /net/OpenTelemetry.Exporter.Zipkin.dll, - /net/OpenTelemetry.Extensions.Propagators.dll, - /net/OpenTelemetry.Instrumentation.AspNetCore.dll, - /net/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, - /net/OpenTelemetry.Instrumentation.GrpcNetClient.dll, - /net/OpenTelemetry.Instrumentation.Http.dll, - /net/OpenTelemetry.Instrumentation.Process.dll, - /net/OpenTelemetry.Instrumentation.Quartz.dll, - /net/OpenTelemetry.Instrumentation.Runtime.dll, - /net/OpenTelemetry.Instrumentation.SqlClient.dll, - /net/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, - /net/OpenTelemetry.Instrumentation.Wcf.dll, - /net/OpenTelemetry.Resources.Azure.dll, - /net/OpenTelemetry.Resources.Container.dll, - /net/OpenTelemetry.Resources.Host.dll, - /net/OpenTelemetry.Resources.OperatingSystem.dll, - /net/OpenTelemetry.Resources.Process.dll, - /net/OpenTelemetry.Resources.ProcessRuntime.dll, - /net/OpenTelemetry.Shims.OpenTracing.dll, - /net/OpenTelemetry.dll, /net/OpenTracing.dll, /net/System.Private.ServiceModel.dll, /net/System.Security.Permissions.dll, /net/System.ServiceModel.Primitives.dll, /net/System.ServiceModel.dll, - /net/ruleEngine.json, - /store/arm64/net10.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/arm64/net10.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/arm64/net10.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/arm64/net10.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/arm64/net10.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/arm64/net10.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/arm64/net10.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/arm64/net10.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/arm64/net10.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/arm64/net10.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/arm64/net10.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/arm64/net8.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/arm64/net8.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/arm64/net8.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/arm64/net8.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/arm64/net8.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/arm64/net8.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/arm64/net8.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/arm64/net8.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/arm64/net8.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/arm64/net8.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/arm64/net8.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/arm64/net8.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll, - /store/arm64/net9.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/arm64/net9.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/arm64/net9.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/arm64/net9.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/arm64/net9.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/arm64/net9.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/arm64/net9.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/arm64/net9.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/arm64/net9.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/arm64/net9.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/arm64/net9.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/arm64/net9.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll + /net/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net10.0/Microsoft.Extensions.Configuration.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net10.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net10.0/Microsoft.Extensions.Logging.dll, + /net/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net10.0/Microsoft.Extensions.Options.dll, + /net/net10.0/Microsoft.Extensions.Primitives.dll, + /net/net10.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net10.0/OpenTelemetry.Api.dll, + /net/net10.0/OpenTelemetry.Exporter.Console.dll, + /net/net10.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net10.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net10.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net10.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net10.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net10.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net10.0/OpenTelemetry.Resources.Azure.dll, + /net/net10.0/OpenTelemetry.Resources.Container.dll, + /net/net10.0/OpenTelemetry.Resources.Host.dll, + /net/net10.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net10.0/OpenTelemetry.Resources.Process.dll, + /net/net10.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net10.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net10.0/OpenTelemetry.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net8.0/Microsoft.Extensions.Configuration.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net8.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net8.0/Microsoft.Extensions.Logging.dll, + /net/net8.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net8.0/Microsoft.Extensions.Options.dll, + /net/net8.0/Microsoft.Extensions.Primitives.dll, + /net/net8.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net8.0/OpenTelemetry.Api.dll, + /net/net8.0/OpenTelemetry.Exporter.Console.dll, + /net/net8.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net8.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net8.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net8.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net8.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net8.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net8.0/OpenTelemetry.Resources.Azure.dll, + /net/net8.0/OpenTelemetry.Resources.Container.dll, + /net/net8.0/OpenTelemetry.Resources.Host.dll, + /net/net8.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net8.0/OpenTelemetry.Resources.Process.dll, + /net/net8.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net8.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net8.0/OpenTelemetry.dll, + /net/net8.0/System.Diagnostics.DiagnosticSource.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net9.0/Microsoft.Extensions.Configuration.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net9.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net9.0/Microsoft.Extensions.Logging.dll, + /net/net9.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net9.0/Microsoft.Extensions.Options.dll, + /net/net9.0/Microsoft.Extensions.Primitives.dll, + /net/net9.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net9.0/OpenTelemetry.Api.dll, + /net/net9.0/OpenTelemetry.Exporter.Console.dll, + /net/net9.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net9.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net9.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net9.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net9.0/OpenTelemetry.Instrumentation.AspNetCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Http.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Process.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Quartz.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Runtime.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.SqlClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Wcf.dll.link, + /net/net9.0/OpenTelemetry.Resources.Azure.dll.link, + /net/net9.0/OpenTelemetry.Resources.Container.dll.link, + /net/net9.0/OpenTelemetry.Resources.Host.dll.link, + /net/net9.0/OpenTelemetry.Resources.OperatingSystem.dll.link, + /net/net9.0/OpenTelemetry.Resources.Process.dll.link, + /net/net9.0/OpenTelemetry.Resources.ProcessRuntime.dll.link, + /net/net9.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net9.0/OpenTelemetry.dll, + /net/net9.0/System.Diagnostics.DiagnosticSource.dll, + /net/ruleEngine.json ] \ No newline at end of file diff --git a/test/IntegrationTests/BuildTests.DistributionStructure_alpine-linux-x64.verified.txt b/test/IntegrationTests/BuildTests.DistributionStructure_alpine-linux-x64.verified.txt index dd7477abec..2777d17c97 100644 --- a/test/IntegrationTests/BuildTests.DistributionStructure_alpine-linux-x64.verified.txt +++ b/test/IntegrationTests/BuildTests.DistributionStructure_alpine-linux-x64.verified.txt @@ -1,14 +1,9 @@ [ - /AdditionalDeps/shared/Microsoft.NETCore.App/10.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/8.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/9.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, /LICENSE, /VERSION, /instrument.sh, /linux-musl-x64/OpenTelemetry.AutoInstrumentation.Native.so, /linux-musl-x64/OpenTelemetry.AutoInstrumentation.Native.so.debug, - /net/OpenTelemetry.Api.ProviderBuilderExtensions.dll, - /net/OpenTelemetry.Api.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.pdb, /net/OpenTelemetry.AutoInstrumentation.Loader.dll, @@ -17,68 +12,123 @@ /net/OpenTelemetry.AutoInstrumentation.StartupHook.pdb, /net/OpenTelemetry.AutoInstrumentation.dll, /net/OpenTelemetry.AutoInstrumentation.pdb, - /net/OpenTelemetry.Exporter.Console.dll, - /net/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, - /net/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, - /net/OpenTelemetry.Exporter.Zipkin.dll, - /net/OpenTelemetry.Extensions.Propagators.dll, - /net/OpenTelemetry.Instrumentation.AspNetCore.dll, - /net/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, - /net/OpenTelemetry.Instrumentation.GrpcNetClient.dll, - /net/OpenTelemetry.Instrumentation.Http.dll, - /net/OpenTelemetry.Instrumentation.Process.dll, - /net/OpenTelemetry.Instrumentation.Quartz.dll, - /net/OpenTelemetry.Instrumentation.Runtime.dll, - /net/OpenTelemetry.Instrumentation.SqlClient.dll, - /net/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, - /net/OpenTelemetry.Instrumentation.Wcf.dll, - /net/OpenTelemetry.Resources.Azure.dll, - /net/OpenTelemetry.Resources.Container.dll, - /net/OpenTelemetry.Resources.Host.dll, - /net/OpenTelemetry.Resources.OperatingSystem.dll, - /net/OpenTelemetry.Resources.Process.dll, - /net/OpenTelemetry.Resources.ProcessRuntime.dll, - /net/OpenTelemetry.Shims.OpenTracing.dll, - /net/OpenTelemetry.dll, /net/OpenTracing.dll, /net/System.Private.ServiceModel.dll, /net/System.Security.Permissions.dll, /net/System.ServiceModel.Primitives.dll, /net/System.ServiceModel.dll, - /net/ruleEngine.json, - /store/x64/net10.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/x64/net10.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/x64/net10.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/x64/net10.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/x64/net10.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/x64/net10.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/x64/net10.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/x64/net10.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/x64/net10.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/x64/net10.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/x64/net10.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/x64/net8.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/x64/net8.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/x64/net8.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/x64/net8.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/x64/net8.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/x64/net8.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/x64/net8.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/x64/net8.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/x64/net8.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/x64/net8.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/x64/net8.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/x64/net8.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll, - /store/x64/net9.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/x64/net9.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/x64/net9.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/x64/net9.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/x64/net9.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/x64/net9.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/x64/net9.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/x64/net9.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/x64/net9.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/x64/net9.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/x64/net9.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/x64/net9.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll + /net/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net10.0/Microsoft.Extensions.Configuration.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net10.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net10.0/Microsoft.Extensions.Logging.dll, + /net/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net10.0/Microsoft.Extensions.Options.dll, + /net/net10.0/Microsoft.Extensions.Primitives.dll, + /net/net10.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net10.0/OpenTelemetry.Api.dll, + /net/net10.0/OpenTelemetry.Exporter.Console.dll, + /net/net10.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net10.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net10.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net10.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net10.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net10.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net10.0/OpenTelemetry.Resources.Azure.dll, + /net/net10.0/OpenTelemetry.Resources.Container.dll, + /net/net10.0/OpenTelemetry.Resources.Host.dll, + /net/net10.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net10.0/OpenTelemetry.Resources.Process.dll, + /net/net10.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net10.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net10.0/OpenTelemetry.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net8.0/Microsoft.Extensions.Configuration.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net8.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net8.0/Microsoft.Extensions.Logging.dll, + /net/net8.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net8.0/Microsoft.Extensions.Options.dll, + /net/net8.0/Microsoft.Extensions.Primitives.dll, + /net/net8.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net8.0/OpenTelemetry.Api.dll, + /net/net8.0/OpenTelemetry.Exporter.Console.dll, + /net/net8.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net8.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net8.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net8.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net8.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net8.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net8.0/OpenTelemetry.Resources.Azure.dll, + /net/net8.0/OpenTelemetry.Resources.Container.dll, + /net/net8.0/OpenTelemetry.Resources.Host.dll, + /net/net8.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net8.0/OpenTelemetry.Resources.Process.dll, + /net/net8.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net8.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net8.0/OpenTelemetry.dll, + /net/net8.0/System.Diagnostics.DiagnosticSource.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net9.0/Microsoft.Extensions.Configuration.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net9.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net9.0/Microsoft.Extensions.Logging.dll, + /net/net9.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net9.0/Microsoft.Extensions.Options.dll, + /net/net9.0/Microsoft.Extensions.Primitives.dll, + /net/net9.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net9.0/OpenTelemetry.Api.dll, + /net/net9.0/OpenTelemetry.Exporter.Console.dll, + /net/net9.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net9.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net9.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net9.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net9.0/OpenTelemetry.Instrumentation.AspNetCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Http.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Process.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Quartz.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Runtime.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.SqlClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Wcf.dll.link, + /net/net9.0/OpenTelemetry.Resources.Azure.dll.link, + /net/net9.0/OpenTelemetry.Resources.Container.dll.link, + /net/net9.0/OpenTelemetry.Resources.Host.dll.link, + /net/net9.0/OpenTelemetry.Resources.OperatingSystem.dll.link, + /net/net9.0/OpenTelemetry.Resources.Process.dll.link, + /net/net9.0/OpenTelemetry.Resources.ProcessRuntime.dll.link, + /net/net9.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net9.0/OpenTelemetry.dll, + /net/net9.0/System.Diagnostics.DiagnosticSource.dll, + /net/ruleEngine.json ] \ No newline at end of file diff --git a/test/IntegrationTests/BuildTests.DistributionStructure_linux-arm64.verified.txt b/test/IntegrationTests/BuildTests.DistributionStructure_linux-arm64.verified.txt index 85041a75e9..170affc464 100644 --- a/test/IntegrationTests/BuildTests.DistributionStructure_linux-arm64.verified.txt +++ b/test/IntegrationTests/BuildTests.DistributionStructure_linux-arm64.verified.txt @@ -1,14 +1,9 @@ [ - /AdditionalDeps/shared/Microsoft.NETCore.App/10.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/8.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/9.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, /LICENSE, /VERSION, /instrument.sh, /linux-arm64/OpenTelemetry.AutoInstrumentation.Native.so, /linux-arm64/OpenTelemetry.AutoInstrumentation.Native.so.debug, - /net/OpenTelemetry.Api.ProviderBuilderExtensions.dll, - /net/OpenTelemetry.Api.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.pdb, /net/OpenTelemetry.AutoInstrumentation.Loader.dll, @@ -17,68 +12,123 @@ /net/OpenTelemetry.AutoInstrumentation.StartupHook.pdb, /net/OpenTelemetry.AutoInstrumentation.dll, /net/OpenTelemetry.AutoInstrumentation.pdb, - /net/OpenTelemetry.Exporter.Console.dll, - /net/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, - /net/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, - /net/OpenTelemetry.Exporter.Zipkin.dll, - /net/OpenTelemetry.Extensions.Propagators.dll, - /net/OpenTelemetry.Instrumentation.AspNetCore.dll, - /net/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, - /net/OpenTelemetry.Instrumentation.GrpcNetClient.dll, - /net/OpenTelemetry.Instrumentation.Http.dll, - /net/OpenTelemetry.Instrumentation.Process.dll, - /net/OpenTelemetry.Instrumentation.Quartz.dll, - /net/OpenTelemetry.Instrumentation.Runtime.dll, - /net/OpenTelemetry.Instrumentation.SqlClient.dll, - /net/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, - /net/OpenTelemetry.Instrumentation.Wcf.dll, - /net/OpenTelemetry.Resources.Azure.dll, - /net/OpenTelemetry.Resources.Container.dll, - /net/OpenTelemetry.Resources.Host.dll, - /net/OpenTelemetry.Resources.OperatingSystem.dll, - /net/OpenTelemetry.Resources.Process.dll, - /net/OpenTelemetry.Resources.ProcessRuntime.dll, - /net/OpenTelemetry.Shims.OpenTracing.dll, - /net/OpenTelemetry.dll, /net/OpenTracing.dll, /net/System.Private.ServiceModel.dll, /net/System.Security.Permissions.dll, /net/System.ServiceModel.Primitives.dll, /net/System.ServiceModel.dll, - /net/ruleEngine.json, - /store/arm64/net10.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/arm64/net10.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/arm64/net10.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/arm64/net10.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/arm64/net10.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/arm64/net10.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/arm64/net10.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/arm64/net10.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/arm64/net10.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/arm64/net10.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/arm64/net10.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/arm64/net8.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/arm64/net8.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/arm64/net8.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/arm64/net8.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/arm64/net8.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/arm64/net8.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/arm64/net8.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/arm64/net8.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/arm64/net8.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/arm64/net8.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/arm64/net8.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/arm64/net8.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll, - /store/arm64/net9.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/arm64/net9.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/arm64/net9.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/arm64/net9.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/arm64/net9.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/arm64/net9.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/arm64/net9.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/arm64/net9.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/arm64/net9.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/arm64/net9.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/arm64/net9.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/arm64/net9.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll + /net/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net10.0/Microsoft.Extensions.Configuration.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net10.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net10.0/Microsoft.Extensions.Logging.dll, + /net/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net10.0/Microsoft.Extensions.Options.dll, + /net/net10.0/Microsoft.Extensions.Primitives.dll, + /net/net10.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net10.0/OpenTelemetry.Api.dll, + /net/net10.0/OpenTelemetry.Exporter.Console.dll, + /net/net10.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net10.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net10.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net10.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net10.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net10.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net10.0/OpenTelemetry.Resources.Azure.dll, + /net/net10.0/OpenTelemetry.Resources.Container.dll, + /net/net10.0/OpenTelemetry.Resources.Host.dll, + /net/net10.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net10.0/OpenTelemetry.Resources.Process.dll, + /net/net10.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net10.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net10.0/OpenTelemetry.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net8.0/Microsoft.Extensions.Configuration.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net8.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net8.0/Microsoft.Extensions.Logging.dll, + /net/net8.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net8.0/Microsoft.Extensions.Options.dll, + /net/net8.0/Microsoft.Extensions.Primitives.dll, + /net/net8.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net8.0/OpenTelemetry.Api.dll, + /net/net8.0/OpenTelemetry.Exporter.Console.dll, + /net/net8.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net8.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net8.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net8.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net8.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net8.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net8.0/OpenTelemetry.Resources.Azure.dll, + /net/net8.0/OpenTelemetry.Resources.Container.dll, + /net/net8.0/OpenTelemetry.Resources.Host.dll, + /net/net8.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net8.0/OpenTelemetry.Resources.Process.dll, + /net/net8.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net8.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net8.0/OpenTelemetry.dll, + /net/net8.0/System.Diagnostics.DiagnosticSource.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net9.0/Microsoft.Extensions.Configuration.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net9.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net9.0/Microsoft.Extensions.Logging.dll, + /net/net9.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net9.0/Microsoft.Extensions.Options.dll, + /net/net9.0/Microsoft.Extensions.Primitives.dll, + /net/net9.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net9.0/OpenTelemetry.Api.dll, + /net/net9.0/OpenTelemetry.Exporter.Console.dll, + /net/net9.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net9.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net9.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net9.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net9.0/OpenTelemetry.Instrumentation.AspNetCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Http.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Process.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Quartz.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Runtime.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.SqlClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Wcf.dll.link, + /net/net9.0/OpenTelemetry.Resources.Azure.dll.link, + /net/net9.0/OpenTelemetry.Resources.Container.dll.link, + /net/net9.0/OpenTelemetry.Resources.Host.dll.link, + /net/net9.0/OpenTelemetry.Resources.OperatingSystem.dll.link, + /net/net9.0/OpenTelemetry.Resources.Process.dll.link, + /net/net9.0/OpenTelemetry.Resources.ProcessRuntime.dll.link, + /net/net9.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net9.0/OpenTelemetry.dll, + /net/net9.0/System.Diagnostics.DiagnosticSource.dll, + /net/ruleEngine.json ] \ No newline at end of file diff --git a/test/IntegrationTests/BuildTests.DistributionStructure_linux-x64.verified.txt b/test/IntegrationTests/BuildTests.DistributionStructure_linux-x64.verified.txt index a527272ee3..4aaf88f3e6 100644 --- a/test/IntegrationTests/BuildTests.DistributionStructure_linux-x64.verified.txt +++ b/test/IntegrationTests/BuildTests.DistributionStructure_linux-x64.verified.txt @@ -1,14 +1,9 @@ [ - /AdditionalDeps/shared/Microsoft.NETCore.App/10.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/8.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/9.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, /LICENSE, /VERSION, /instrument.sh, /linux-x64/OpenTelemetry.AutoInstrumentation.Native.so, /linux-x64/OpenTelemetry.AutoInstrumentation.Native.so.debug, - /net/OpenTelemetry.Api.ProviderBuilderExtensions.dll, - /net/OpenTelemetry.Api.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.pdb, /net/OpenTelemetry.AutoInstrumentation.Loader.dll, @@ -17,68 +12,123 @@ /net/OpenTelemetry.AutoInstrumentation.StartupHook.pdb, /net/OpenTelemetry.AutoInstrumentation.dll, /net/OpenTelemetry.AutoInstrumentation.pdb, - /net/OpenTelemetry.Exporter.Console.dll, - /net/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, - /net/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, - /net/OpenTelemetry.Exporter.Zipkin.dll, - /net/OpenTelemetry.Extensions.Propagators.dll, - /net/OpenTelemetry.Instrumentation.AspNetCore.dll, - /net/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, - /net/OpenTelemetry.Instrumentation.GrpcNetClient.dll, - /net/OpenTelemetry.Instrumentation.Http.dll, - /net/OpenTelemetry.Instrumentation.Process.dll, - /net/OpenTelemetry.Instrumentation.Quartz.dll, - /net/OpenTelemetry.Instrumentation.Runtime.dll, - /net/OpenTelemetry.Instrumentation.SqlClient.dll, - /net/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, - /net/OpenTelemetry.Instrumentation.Wcf.dll, - /net/OpenTelemetry.Resources.Azure.dll, - /net/OpenTelemetry.Resources.Container.dll, - /net/OpenTelemetry.Resources.Host.dll, - /net/OpenTelemetry.Resources.OperatingSystem.dll, - /net/OpenTelemetry.Resources.Process.dll, - /net/OpenTelemetry.Resources.ProcessRuntime.dll, - /net/OpenTelemetry.Shims.OpenTracing.dll, - /net/OpenTelemetry.dll, /net/OpenTracing.dll, /net/System.Private.ServiceModel.dll, /net/System.Security.Permissions.dll, /net/System.ServiceModel.Primitives.dll, /net/System.ServiceModel.dll, - /net/ruleEngine.json, - /store/x64/net10.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/x64/net10.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/x64/net10.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/x64/net10.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/x64/net10.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/x64/net10.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/x64/net10.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/x64/net10.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/x64/net10.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/x64/net10.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/x64/net10.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/x64/net8.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/x64/net8.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/x64/net8.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/x64/net8.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/x64/net8.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/x64/net8.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/x64/net8.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/x64/net8.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/x64/net8.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/x64/net8.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/x64/net8.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/x64/net8.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll, - /store/x64/net9.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/x64/net9.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/x64/net9.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/x64/net9.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/x64/net9.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/x64/net9.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/x64/net9.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/x64/net9.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/x64/net9.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/x64/net9.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/x64/net9.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/x64/net9.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll + /net/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net10.0/Microsoft.Extensions.Configuration.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net10.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net10.0/Microsoft.Extensions.Logging.dll, + /net/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net10.0/Microsoft.Extensions.Options.dll, + /net/net10.0/Microsoft.Extensions.Primitives.dll, + /net/net10.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net10.0/OpenTelemetry.Api.dll, + /net/net10.0/OpenTelemetry.Exporter.Console.dll, + /net/net10.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net10.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net10.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net10.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net10.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net10.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net10.0/OpenTelemetry.Resources.Azure.dll, + /net/net10.0/OpenTelemetry.Resources.Container.dll, + /net/net10.0/OpenTelemetry.Resources.Host.dll, + /net/net10.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net10.0/OpenTelemetry.Resources.Process.dll, + /net/net10.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net10.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net10.0/OpenTelemetry.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net8.0/Microsoft.Extensions.Configuration.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net8.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net8.0/Microsoft.Extensions.Logging.dll, + /net/net8.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net8.0/Microsoft.Extensions.Options.dll, + /net/net8.0/Microsoft.Extensions.Primitives.dll, + /net/net8.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net8.0/OpenTelemetry.Api.dll, + /net/net8.0/OpenTelemetry.Exporter.Console.dll, + /net/net8.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net8.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net8.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net8.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net8.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net8.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net8.0/OpenTelemetry.Resources.Azure.dll, + /net/net8.0/OpenTelemetry.Resources.Container.dll, + /net/net8.0/OpenTelemetry.Resources.Host.dll, + /net/net8.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net8.0/OpenTelemetry.Resources.Process.dll, + /net/net8.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net8.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net8.0/OpenTelemetry.dll, + /net/net8.0/System.Diagnostics.DiagnosticSource.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net9.0/Microsoft.Extensions.Configuration.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net9.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net9.0/Microsoft.Extensions.Logging.dll, + /net/net9.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net9.0/Microsoft.Extensions.Options.dll, + /net/net9.0/Microsoft.Extensions.Primitives.dll, + /net/net9.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net9.0/OpenTelemetry.Api.dll, + /net/net9.0/OpenTelemetry.Exporter.Console.dll, + /net/net9.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net9.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net9.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net9.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net9.0/OpenTelemetry.Instrumentation.AspNetCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Http.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Process.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Quartz.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Runtime.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.SqlClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Wcf.dll.link, + /net/net9.0/OpenTelemetry.Resources.Azure.dll.link, + /net/net9.0/OpenTelemetry.Resources.Container.dll.link, + /net/net9.0/OpenTelemetry.Resources.Host.dll.link, + /net/net9.0/OpenTelemetry.Resources.OperatingSystem.dll.link, + /net/net9.0/OpenTelemetry.Resources.Process.dll.link, + /net/net9.0/OpenTelemetry.Resources.ProcessRuntime.dll.link, + /net/net9.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net9.0/OpenTelemetry.dll, + /net/net9.0/System.Diagnostics.DiagnosticSource.dll, + /net/ruleEngine.json ] \ No newline at end of file diff --git a/test/IntegrationTests/BuildTests.DistributionStructure_osx.verified.txt b/test/IntegrationTests/BuildTests.DistributionStructure_osx.verified.txt index 33684f4fc4..8756bf4ca7 100644 --- a/test/IntegrationTests/BuildTests.DistributionStructure_osx.verified.txt +++ b/test/IntegrationTests/BuildTests.DistributionStructure_osx.verified.txt @@ -1,12 +1,7 @@ [ - /AdditionalDeps/shared/Microsoft.NETCore.App/10.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/8.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - /AdditionalDeps/shared/Microsoft.NETCore.App/9.0.0/OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, /LICENSE, /VERSION, /instrument.sh, - /net/OpenTelemetry.Api.ProviderBuilderExtensions.dll, - /net/OpenTelemetry.Api.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.dll, /net/OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.pdb, /net/OpenTelemetry.AutoInstrumentation.Loader.dll, @@ -15,69 +10,124 @@ /net/OpenTelemetry.AutoInstrumentation.StartupHook.pdb, /net/OpenTelemetry.AutoInstrumentation.dll, /net/OpenTelemetry.AutoInstrumentation.pdb, - /net/OpenTelemetry.Exporter.Console.dll, - /net/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, - /net/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, - /net/OpenTelemetry.Exporter.Zipkin.dll, - /net/OpenTelemetry.Extensions.Propagators.dll, - /net/OpenTelemetry.Instrumentation.AspNetCore.dll, - /net/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, - /net/OpenTelemetry.Instrumentation.GrpcNetClient.dll, - /net/OpenTelemetry.Instrumentation.Http.dll, - /net/OpenTelemetry.Instrumentation.Process.dll, - /net/OpenTelemetry.Instrumentation.Quartz.dll, - /net/OpenTelemetry.Instrumentation.Runtime.dll, - /net/OpenTelemetry.Instrumentation.SqlClient.dll, - /net/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, - /net/OpenTelemetry.Instrumentation.Wcf.dll, - /net/OpenTelemetry.Resources.Azure.dll, - /net/OpenTelemetry.Resources.Container.dll, - /net/OpenTelemetry.Resources.Host.dll, - /net/OpenTelemetry.Resources.OperatingSystem.dll, - /net/OpenTelemetry.Resources.Process.dll, - /net/OpenTelemetry.Resources.ProcessRuntime.dll, - /net/OpenTelemetry.Shims.OpenTracing.dll, - /net/OpenTelemetry.dll, /net/OpenTracing.dll, /net/System.Private.ServiceModel.dll, /net/System.Security.Permissions.dll, /net/System.ServiceModel.Primitives.dll, /net/System.ServiceModel.dll, + /net/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net10.0/Microsoft.Extensions.Configuration.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net10.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net10.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net10.0/Microsoft.Extensions.Logging.dll, + /net/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net10.0/Microsoft.Extensions.Options.dll, + /net/net10.0/Microsoft.Extensions.Primitives.dll, + /net/net10.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net10.0/OpenTelemetry.Api.dll, + /net/net10.0/OpenTelemetry.Exporter.Console.dll, + /net/net10.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net10.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net10.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net10.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net10.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net10.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net10.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net10.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net10.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net10.0/OpenTelemetry.Resources.Azure.dll, + /net/net10.0/OpenTelemetry.Resources.Container.dll, + /net/net10.0/OpenTelemetry.Resources.Host.dll, + /net/net10.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net10.0/OpenTelemetry.Resources.Process.dll, + /net/net10.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net10.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net10.0/OpenTelemetry.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net8.0/Microsoft.Extensions.Configuration.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net8.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net8.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net8.0/Microsoft.Extensions.Logging.dll, + /net/net8.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net8.0/Microsoft.Extensions.Options.dll, + /net/net8.0/Microsoft.Extensions.Primitives.dll, + /net/net8.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net8.0/OpenTelemetry.Api.dll, + /net/net8.0/OpenTelemetry.Exporter.Console.dll, + /net/net8.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net8.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net8.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net8.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net8.0/OpenTelemetry.Instrumentation.AspNetCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + /net/net8.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Http.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Process.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Quartz.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Runtime.dll, + /net/net8.0/OpenTelemetry.Instrumentation.SqlClient.dll, + /net/net8.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + /net/net8.0/OpenTelemetry.Instrumentation.Wcf.dll, + /net/net8.0/OpenTelemetry.Resources.Azure.dll, + /net/net8.0/OpenTelemetry.Resources.Container.dll, + /net/net8.0/OpenTelemetry.Resources.Host.dll, + /net/net8.0/OpenTelemetry.Resources.OperatingSystem.dll, + /net/net8.0/OpenTelemetry.Resources.Process.dll, + /net/net8.0/OpenTelemetry.Resources.ProcessRuntime.dll, + /net/net8.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net8.0/OpenTelemetry.dll, + /net/net8.0/System.Diagnostics.DiagnosticSource.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Configuration.Binder.dll, + /net/net9.0/Microsoft.Extensions.Configuration.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.DependencyInjection.dll, + /net/net9.0/Microsoft.Extensions.Diagnostics.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Abstractions.dll, + /net/net9.0/Microsoft.Extensions.Logging.Configuration.dll, + /net/net9.0/Microsoft.Extensions.Logging.dll, + /net/net9.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, + /net/net9.0/Microsoft.Extensions.Options.dll, + /net/net9.0/Microsoft.Extensions.Primitives.dll, + /net/net9.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll, + /net/net9.0/OpenTelemetry.Api.dll, + /net/net9.0/OpenTelemetry.Exporter.Console.dll, + /net/net9.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + /net/net9.0/OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + /net/net9.0/OpenTelemetry.Exporter.Zipkin.dll, + /net/net9.0/OpenTelemetry.Extensions.Propagators.dll, + /net/net9.0/OpenTelemetry.Instrumentation.AspNetCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.GrpcNetClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Http.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Process.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Quartz.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Runtime.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.SqlClient.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.StackExchangeRedis.dll.link, + /net/net9.0/OpenTelemetry.Instrumentation.Wcf.dll.link, + /net/net9.0/OpenTelemetry.Resources.Azure.dll.link, + /net/net9.0/OpenTelemetry.Resources.Container.dll.link, + /net/net9.0/OpenTelemetry.Resources.Host.dll.link, + /net/net9.0/OpenTelemetry.Resources.OperatingSystem.dll.link, + /net/net9.0/OpenTelemetry.Resources.Process.dll.link, + /net/net9.0/OpenTelemetry.Resources.ProcessRuntime.dll.link, + /net/net9.0/OpenTelemetry.Shims.OpenTracing.dll, + /net/net9.0/OpenTelemetry.dll, + /net/net9.0/System.Diagnostics.DiagnosticSource.dll, /net/ruleEngine.json, - /osx-arm64/OpenTelemetry.AutoInstrumentation.Native.dylib, - /store/arm64/net10.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/arm64/net10.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/arm64/net10.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/arm64/net10.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/arm64/net10.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/arm64/net10.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/arm64/net10.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/arm64/net10.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/arm64/net10.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/arm64/net10.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/arm64/net10.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/arm64/net8.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/arm64/net8.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/arm64/net8.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/arm64/net8.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/arm64/net8.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/arm64/net8.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/arm64/net8.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/arm64/net8.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/arm64/net8.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/arm64/net8.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/arm64/net8.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/arm64/net8.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll, - /store/arm64/net9.0/microsoft.extensions.configuration.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.Abstractions.dll, - /store/arm64/net9.0/microsoft.extensions.configuration.binder/8.0.2/lib/net10.0/Microsoft.Extensions.Configuration.Binder.dll, - /store/arm64/net9.0/microsoft.extensions.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Configuration.dll, - /store/arm64/net9.0/microsoft.extensions.dependencyinjection.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll, - /store/arm64/net9.0/microsoft.extensions.dependencyinjection/8.0.0/lib/net10.0/Microsoft.Extensions.DependencyInjection.dll, - /store/arm64/net9.0/microsoft.extensions.logging.abstractions/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Abstractions.dll, - /store/arm64/net9.0/microsoft.extensions.logging.configuration/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.Configuration.dll, - /store/arm64/net9.0/microsoft.extensions.logging/8.0.0/lib/net10.0/Microsoft.Extensions.Logging.dll, - /store/arm64/net9.0/microsoft.extensions.options.configurationextensions/8.0.0/lib/net10.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll, - /store/arm64/net9.0/microsoft.extensions.options/8.0.0/lib/net10.0/Microsoft.Extensions.Options.dll, - /store/arm64/net9.0/microsoft.extensions.primitives/8.0.0/lib/net10.0/Microsoft.Extensions.Primitives.dll, - /store/arm64/net9.0/system.diagnostics.diagnosticsource/10.0.0/lib/net10.0/System.Diagnostics.DiagnosticSource.dll + /osx-arm64/OpenTelemetry.AutoInstrumentation.Native.dylib ] \ No newline at end of file diff --git a/test/IntegrationTests/BuildTests.DistributionStructure_windows.verified.txt b/test/IntegrationTests/BuildTests.DistributionStructure_windows.verified.txt index d7e188d66c..b20df39208 100644 --- a/test/IntegrationTests/BuildTests.DistributionStructure_windows.verified.txt +++ b/test/IntegrationTests/BuildTests.DistributionStructure_windows.verified.txt @@ -1,12 +1,7 @@ [ - \AdditionalDeps\shared\Microsoft.NETCore.App\10.0.0\OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - \AdditionalDeps\shared\Microsoft.NETCore.App\8.0.0\OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, - \AdditionalDeps\shared\Microsoft.NETCore.App\9.0.0\OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json, \LICENSE, \VERSION, \instrument.sh, - \net\OpenTelemetry.Api.ProviderBuilderExtensions.dll, - \net\OpenTelemetry.Api.dll, \net\OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.dll, \net\OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.pdb, \net\OpenTelemetry.AutoInstrumentation.Loader.dll, @@ -15,34 +10,124 @@ \net\OpenTelemetry.AutoInstrumentation.StartupHook.pdb, \net\OpenTelemetry.AutoInstrumentation.dll, \net\OpenTelemetry.AutoInstrumentation.pdb, - \net\OpenTelemetry.Exporter.Console.dll, - \net\OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, - \net\OpenTelemetry.Exporter.Prometheus.HttpListener.dll, - \net\OpenTelemetry.Exporter.Zipkin.dll, - \net\OpenTelemetry.Extensions.Propagators.dll, - \net\OpenTelemetry.Instrumentation.AspNetCore.dll, - \net\OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, - \net\OpenTelemetry.Instrumentation.GrpcNetClient.dll, - \net\OpenTelemetry.Instrumentation.Http.dll, - \net\OpenTelemetry.Instrumentation.Process.dll, - \net\OpenTelemetry.Instrumentation.Quartz.dll, - \net\OpenTelemetry.Instrumentation.Runtime.dll, - \net\OpenTelemetry.Instrumentation.SqlClient.dll, - \net\OpenTelemetry.Instrumentation.StackExchangeRedis.dll, - \net\OpenTelemetry.Instrumentation.Wcf.dll, - \net\OpenTelemetry.Resources.Azure.dll, - \net\OpenTelemetry.Resources.Container.dll, - \net\OpenTelemetry.Resources.Host.dll, - \net\OpenTelemetry.Resources.OperatingSystem.dll, - \net\OpenTelemetry.Resources.Process.dll, - \net\OpenTelemetry.Resources.ProcessRuntime.dll, - \net\OpenTelemetry.Shims.OpenTracing.dll, - \net\OpenTelemetry.dll, \net\OpenTracing.dll, \net\System.Private.ServiceModel.dll, \net\System.Security.Permissions.dll, \net\System.ServiceModel.Primitives.dll, \net\System.ServiceModel.dll, + \net\net10.0\Microsoft.Extensions.Configuration.Abstractions.dll, + \net\net10.0\Microsoft.Extensions.Configuration.Binder.dll, + \net\net10.0\Microsoft.Extensions.Configuration.dll, + \net\net10.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll, + \net\net10.0\Microsoft.Extensions.DependencyInjection.dll, + \net\net10.0\Microsoft.Extensions.Diagnostics.Abstractions.dll, + \net\net10.0\Microsoft.Extensions.Logging.Abstractions.dll, + \net\net10.0\Microsoft.Extensions.Logging.Configuration.dll, + \net\net10.0\Microsoft.Extensions.Logging.dll, + \net\net10.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll, + \net\net10.0\Microsoft.Extensions.Options.dll, + \net\net10.0\Microsoft.Extensions.Primitives.dll, + \net\net10.0\OpenTelemetry.Api.ProviderBuilderExtensions.dll, + \net\net10.0\OpenTelemetry.Api.dll, + \net\net10.0\OpenTelemetry.Exporter.Console.dll, + \net\net10.0\OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + \net\net10.0\OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + \net\net10.0\OpenTelemetry.Exporter.Zipkin.dll, + \net\net10.0\OpenTelemetry.Extensions.Propagators.dll, + \net\net10.0\OpenTelemetry.Instrumentation.AspNetCore.dll, + \net\net10.0\OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + \net\net10.0\OpenTelemetry.Instrumentation.GrpcNetClient.dll, + \net\net10.0\OpenTelemetry.Instrumentation.Http.dll, + \net\net10.0\OpenTelemetry.Instrumentation.Process.dll, + \net\net10.0\OpenTelemetry.Instrumentation.Quartz.dll, + \net\net10.0\OpenTelemetry.Instrumentation.Runtime.dll, + \net\net10.0\OpenTelemetry.Instrumentation.SqlClient.dll, + \net\net10.0\OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + \net\net10.0\OpenTelemetry.Instrumentation.Wcf.dll, + \net\net10.0\OpenTelemetry.Resources.Azure.dll, + \net\net10.0\OpenTelemetry.Resources.Container.dll, + \net\net10.0\OpenTelemetry.Resources.Host.dll, + \net\net10.0\OpenTelemetry.Resources.OperatingSystem.dll, + \net\net10.0\OpenTelemetry.Resources.Process.dll, + \net\net10.0\OpenTelemetry.Resources.ProcessRuntime.dll, + \net\net10.0\OpenTelemetry.Shims.OpenTracing.dll, + \net\net10.0\OpenTelemetry.dll, + \net\net8.0\Microsoft.Extensions.Configuration.Abstractions.dll, + \net\net8.0\Microsoft.Extensions.Configuration.Binder.dll, + \net\net8.0\Microsoft.Extensions.Configuration.dll, + \net\net8.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll, + \net\net8.0\Microsoft.Extensions.DependencyInjection.dll, + \net\net8.0\Microsoft.Extensions.Diagnostics.Abstractions.dll, + \net\net8.0\Microsoft.Extensions.Logging.Abstractions.dll, + \net\net8.0\Microsoft.Extensions.Logging.Configuration.dll, + \net\net8.0\Microsoft.Extensions.Logging.dll, + \net\net8.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll, + \net\net8.0\Microsoft.Extensions.Options.dll, + \net\net8.0\Microsoft.Extensions.Primitives.dll, + \net\net8.0\OpenTelemetry.Api.ProviderBuilderExtensions.dll, + \net\net8.0\OpenTelemetry.Api.dll, + \net\net8.0\OpenTelemetry.Exporter.Console.dll, + \net\net8.0\OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + \net\net8.0\OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + \net\net8.0\OpenTelemetry.Exporter.Zipkin.dll, + \net\net8.0\OpenTelemetry.Extensions.Propagators.dll, + \net\net8.0\OpenTelemetry.Instrumentation.AspNetCore.dll, + \net\net8.0\OpenTelemetry.Instrumentation.EntityFrameworkCore.dll, + \net\net8.0\OpenTelemetry.Instrumentation.GrpcNetClient.dll, + \net\net8.0\OpenTelemetry.Instrumentation.Http.dll, + \net\net8.0\OpenTelemetry.Instrumentation.Process.dll, + \net\net8.0\OpenTelemetry.Instrumentation.Quartz.dll, + \net\net8.0\OpenTelemetry.Instrumentation.Runtime.dll, + \net\net8.0\OpenTelemetry.Instrumentation.SqlClient.dll, + \net\net8.0\OpenTelemetry.Instrumentation.StackExchangeRedis.dll, + \net\net8.0\OpenTelemetry.Instrumentation.Wcf.dll, + \net\net8.0\OpenTelemetry.Resources.Azure.dll, + \net\net8.0\OpenTelemetry.Resources.Container.dll, + \net\net8.0\OpenTelemetry.Resources.Host.dll, + \net\net8.0\OpenTelemetry.Resources.OperatingSystem.dll, + \net\net8.0\OpenTelemetry.Resources.Process.dll, + \net\net8.0\OpenTelemetry.Resources.ProcessRuntime.dll, + \net\net8.0\OpenTelemetry.Shims.OpenTracing.dll, + \net\net8.0\OpenTelemetry.dll, + \net\net8.0\System.Diagnostics.DiagnosticSource.dll, + \net\net9.0\Microsoft.Extensions.Configuration.Abstractions.dll, + \net\net9.0\Microsoft.Extensions.Configuration.Binder.dll, + \net\net9.0\Microsoft.Extensions.Configuration.dll, + \net\net9.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll, + \net\net9.0\Microsoft.Extensions.DependencyInjection.dll, + \net\net9.0\Microsoft.Extensions.Diagnostics.Abstractions.dll, + \net\net9.0\Microsoft.Extensions.Logging.Abstractions.dll, + \net\net9.0\Microsoft.Extensions.Logging.Configuration.dll, + \net\net9.0\Microsoft.Extensions.Logging.dll, + \net\net9.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll, + \net\net9.0\Microsoft.Extensions.Options.dll, + \net\net9.0\Microsoft.Extensions.Primitives.dll, + \net\net9.0\OpenTelemetry.Api.ProviderBuilderExtensions.dll, + \net\net9.0\OpenTelemetry.Api.dll, + \net\net9.0\OpenTelemetry.Exporter.Console.dll, + \net\net9.0\OpenTelemetry.Exporter.OpenTelemetryProtocol.dll, + \net\net9.0\OpenTelemetry.Exporter.Prometheus.HttpListener.dll, + \net\net9.0\OpenTelemetry.Exporter.Zipkin.dll, + \net\net9.0\OpenTelemetry.Extensions.Propagators.dll, + \net\net9.0\OpenTelemetry.Instrumentation.AspNetCore.dll.link, + \net\net9.0\OpenTelemetry.Instrumentation.EntityFrameworkCore.dll.link, + \net\net9.0\OpenTelemetry.Instrumentation.GrpcNetClient.dll.link, + \net\net9.0\OpenTelemetry.Instrumentation.Http.dll.link, + \net\net9.0\OpenTelemetry.Instrumentation.Process.dll.link, + \net\net9.0\OpenTelemetry.Instrumentation.Quartz.dll.link, + \net\net9.0\OpenTelemetry.Instrumentation.Runtime.dll.link, + \net\net9.0\OpenTelemetry.Instrumentation.SqlClient.dll.link, + \net\net9.0\OpenTelemetry.Instrumentation.StackExchangeRedis.dll.link, + \net\net9.0\OpenTelemetry.Instrumentation.Wcf.dll.link, + \net\net9.0\OpenTelemetry.Resources.Azure.dll.link, + \net\net9.0\OpenTelemetry.Resources.Container.dll.link, + \net\net9.0\OpenTelemetry.Resources.Host.dll.link, + \net\net9.0\OpenTelemetry.Resources.OperatingSystem.dll.link, + \net\net9.0\OpenTelemetry.Resources.Process.dll.link, + \net\net9.0\OpenTelemetry.Resources.ProcessRuntime.dll.link, + \net\net9.0\OpenTelemetry.Shims.OpenTracing.dll, + \net\net9.0\OpenTelemetry.dll, + \net\net9.0\System.Diagnostics.DiagnosticSource.dll, \net\ruleEngine.json, \netfx\Microsoft.Bcl.AsyncInterfaces.dll, \netfx\Microsoft.Extensions.Configuration.Abstractions.dll, @@ -298,76 +383,6 @@ \netfx\net47\System.Xml.XmlDocument.dll.link, \netfx\net47\System.Xml.XmlSerializer.dll.link, \netfx\net47\netstandard.dll.link, - \store\x64\net10.0\microsoft.extensions.configuration.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.Abstractions.dll, - \store\x64\net10.0\microsoft.extensions.configuration.binder\8.0.2\lib\net10.0\Microsoft.Extensions.Configuration.Binder.dll, - \store\x64\net10.0\microsoft.extensions.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.dll, - \store\x64\net10.0\microsoft.extensions.dependencyinjection.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll, - \store\x64\net10.0\microsoft.extensions.dependencyinjection\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.dll, - \store\x64\net10.0\microsoft.extensions.logging.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Abstractions.dll, - \store\x64\net10.0\microsoft.extensions.logging.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Configuration.dll, - \store\x64\net10.0\microsoft.extensions.logging\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.dll, - \store\x64\net10.0\microsoft.extensions.options.configurationextensions\8.0.0\lib\net10.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll, - \store\x64\net10.0\microsoft.extensions.options\8.0.0\lib\net10.0\Microsoft.Extensions.Options.dll, - \store\x64\net10.0\microsoft.extensions.primitives\8.0.0\lib\net10.0\Microsoft.Extensions.Primitives.dll, - \store\x64\net8.0\microsoft.extensions.configuration.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.Abstractions.dll, - \store\x64\net8.0\microsoft.extensions.configuration.binder\8.0.2\lib\net10.0\Microsoft.Extensions.Configuration.Binder.dll, - \store\x64\net8.0\microsoft.extensions.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.dll, - \store\x64\net8.0\microsoft.extensions.dependencyinjection.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll, - \store\x64\net8.0\microsoft.extensions.dependencyinjection\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.dll, - \store\x64\net8.0\microsoft.extensions.logging.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Abstractions.dll, - \store\x64\net8.0\microsoft.extensions.logging.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Configuration.dll, - \store\x64\net8.0\microsoft.extensions.logging\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.dll, - \store\x64\net8.0\microsoft.extensions.options.configurationextensions\8.0.0\lib\net10.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll, - \store\x64\net8.0\microsoft.extensions.options\8.0.0\lib\net10.0\Microsoft.Extensions.Options.dll, - \store\x64\net8.0\microsoft.extensions.primitives\8.0.0\lib\net10.0\Microsoft.Extensions.Primitives.dll, - \store\x64\net8.0\system.diagnostics.diagnosticsource\10.0.0\lib\net10.0\System.Diagnostics.DiagnosticSource.dll, - \store\x64\net9.0\microsoft.extensions.configuration.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.Abstractions.dll, - \store\x64\net9.0\microsoft.extensions.configuration.binder\8.0.2\lib\net10.0\Microsoft.Extensions.Configuration.Binder.dll, - \store\x64\net9.0\microsoft.extensions.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.dll, - \store\x64\net9.0\microsoft.extensions.dependencyinjection.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll, - \store\x64\net9.0\microsoft.extensions.dependencyinjection\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.dll, - \store\x64\net9.0\microsoft.extensions.logging.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Abstractions.dll, - \store\x64\net9.0\microsoft.extensions.logging.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Configuration.dll, - \store\x64\net9.0\microsoft.extensions.logging\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.dll, - \store\x64\net9.0\microsoft.extensions.options.configurationextensions\8.0.0\lib\net10.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll, - \store\x64\net9.0\microsoft.extensions.options\8.0.0\lib\net10.0\Microsoft.Extensions.Options.dll, - \store\x64\net9.0\microsoft.extensions.primitives\8.0.0\lib\net10.0\Microsoft.Extensions.Primitives.dll, - \store\x64\net9.0\system.diagnostics.diagnosticsource\10.0.0\lib\net10.0\System.Diagnostics.DiagnosticSource.dll, - \store\x86\net10.0\microsoft.extensions.configuration.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.Abstractions.dll, - \store\x86\net10.0\microsoft.extensions.configuration.binder\8.0.2\lib\net10.0\Microsoft.Extensions.Configuration.Binder.dll, - \store\x86\net10.0\microsoft.extensions.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.dll, - \store\x86\net10.0\microsoft.extensions.dependencyinjection.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll, - \store\x86\net10.0\microsoft.extensions.dependencyinjection\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.dll, - \store\x86\net10.0\microsoft.extensions.logging.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Abstractions.dll, - \store\x86\net10.0\microsoft.extensions.logging.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Configuration.dll, - \store\x86\net10.0\microsoft.extensions.logging\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.dll, - \store\x86\net10.0\microsoft.extensions.options.configurationextensions\8.0.0\lib\net10.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll, - \store\x86\net10.0\microsoft.extensions.options\8.0.0\lib\net10.0\Microsoft.Extensions.Options.dll, - \store\x86\net10.0\microsoft.extensions.primitives\8.0.0\lib\net10.0\Microsoft.Extensions.Primitives.dll, - \store\x86\net8.0\microsoft.extensions.configuration.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.Abstractions.dll, - \store\x86\net8.0\microsoft.extensions.configuration.binder\8.0.2\lib\net10.0\Microsoft.Extensions.Configuration.Binder.dll, - \store\x86\net8.0\microsoft.extensions.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.dll, - \store\x86\net8.0\microsoft.extensions.dependencyinjection.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll, - \store\x86\net8.0\microsoft.extensions.dependencyinjection\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.dll, - \store\x86\net8.0\microsoft.extensions.logging.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Abstractions.dll, - \store\x86\net8.0\microsoft.extensions.logging.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Configuration.dll, - \store\x86\net8.0\microsoft.extensions.logging\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.dll, - \store\x86\net8.0\microsoft.extensions.options.configurationextensions\8.0.0\lib\net10.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll, - \store\x86\net8.0\microsoft.extensions.options\8.0.0\lib\net10.0\Microsoft.Extensions.Options.dll, - \store\x86\net8.0\microsoft.extensions.primitives\8.0.0\lib\net10.0\Microsoft.Extensions.Primitives.dll, - \store\x86\net8.0\system.diagnostics.diagnosticsource\10.0.0\lib\net10.0\System.Diagnostics.DiagnosticSource.dll, - \store\x86\net9.0\microsoft.extensions.configuration.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.Abstractions.dll, - \store\x86\net9.0\microsoft.extensions.configuration.binder\8.0.2\lib\net10.0\Microsoft.Extensions.Configuration.Binder.dll, - \store\x86\net9.0\microsoft.extensions.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Configuration.dll, - \store\x86\net9.0\microsoft.extensions.dependencyinjection.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll, - \store\x86\net9.0\microsoft.extensions.dependencyinjection\8.0.0\lib\net10.0\Microsoft.Extensions.DependencyInjection.dll, - \store\x86\net9.0\microsoft.extensions.logging.abstractions\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Abstractions.dll, - \store\x86\net9.0\microsoft.extensions.logging.configuration\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.Configuration.dll, - \store\x86\net9.0\microsoft.extensions.logging\8.0.0\lib\net10.0\Microsoft.Extensions.Logging.dll, - \store\x86\net9.0\microsoft.extensions.options.configurationextensions\8.0.0\lib\net10.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll, - \store\x86\net9.0\microsoft.extensions.options\8.0.0\lib\net10.0\Microsoft.Extensions.Options.dll, - \store\x86\net9.0\microsoft.extensions.primitives\8.0.0\lib\net10.0\Microsoft.Extensions.Primitives.dll, - \store\x86\net9.0\system.diagnostics.diagnosticsource\10.0.0\lib\net10.0\System.Diagnostics.DiagnosticSource.dll, \win-x64\OpenTelemetry.AutoInstrumentation.Native.dll, \win-x64\OpenTelemetry.AutoInstrumentation.Native.pdb, \win-x86\OpenTelemetry.AutoInstrumentation.Native.dll, diff --git a/test/IntegrationTests/BuildTests.cs b/test/IntegrationTests/BuildTests.cs index 31db2349db..452f766e04 100644 --- a/test/IntegrationTests/BuildTests.cs +++ b/test/IntegrationTests/BuildTests.cs @@ -29,22 +29,6 @@ public Task DistributionStructure() .DisableDiff(); } -#if NET - [Fact] - public void NetFolderDoesNotContainAnyLibraryFromAdditionalStore() - { - var distributionFolder = EnvironmentHelper.GetNukeBuildOutput(); - - var netFilePaths = Directory.GetFiles(Path.Join(distributionFolder, "net"), "*", SearchOption.AllDirectories); - var additionalStoreFilePaths = Directory.GetFiles(Path.Join(distributionFolder, "store"), "*", SearchOption.AllDirectories); - - var netFileNames = netFilePaths.Select(Path.GetFileNameWithoutExtension).ToArray(); - var additionalStoreFileNames = additionalStoreFilePaths.Select(Path.GetFileNameWithoutExtension).Distinct().ToArray(); - - Assert.All(additionalStoreFileNames, additionalNetFileName => Assert.DoesNotContain(additionalNetFileName, netFileNames)); - } -#endif - private static string GetSystemName() { if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) diff --git a/test/IntegrationTests/CustomSdkTests.cs b/test/IntegrationTests/CustomSdkTests.cs index b2b5c3a5fc..1c33c66fa0 100644 --- a/test/IntegrationTests/CustomSdkTests.cs +++ b/test/IntegrationTests/CustomSdkTests.cs @@ -73,7 +73,7 @@ public void SubmitsMetrics() SetEnvironmentVariable("LONG_RUNNING", "true"); SetEnvironmentVariable("OTEL_METRIC_EXPORT_INTERVAL", "100"); - var process = StartTestApplication(new() + using var process = StartTestApplication(new() { Arguments = $"--redis-port {_redis.Port} --test-server-port {testServer.Port}" }); diff --git a/test/IntegrationTests/GraphQLTests.cs b/test/IntegrationTests/GraphQLTests.cs index b39c719940..134323145a 100644 --- a/test/IntegrationTests/GraphQLTests.cs +++ b/test/IntegrationTests/GraphQLTests.cs @@ -70,7 +70,8 @@ public async Task SubmitsTraces(string packageVersion, bool setDocument) SetEnvironmentVariable("OTEL_DOTNET_AUTO_TRACES_GRAPHQL_INSTRUMENTATION_ENABLED", "true"); SetEnvironmentVariable("OTEL_DOTNET_AUTO_TRACES_ASPNETCORE_INSTRUMENTATION_ENABLED", "true"); // AspNetCore Instrumentation enables propagation used in this test SetEnvironmentVariable("OTEL_TRACES_SAMPLER", "always_on"); - SetEnvironmentVariable("OTEL_DOTNET_AUTO_NETFX_REDIRECT_ENABLED", "false"); + // TODO why do we set this parameter if this test doesn't use Native profiler that would process it? + SetEnvironmentVariable("OTEL_DOTNET_AUTO_REDIRECT_ENABLED", "false"); int aspNetCorePort = TcpPortProvider.GetOpenPort(); SetEnvironmentVariable("ASPNETCORE_URLS", $"http://127.0.0.1:{aspNetCorePort}/"); diff --git a/test/IntegrationTests/Helpers/EnvironmentHelper.cs b/test/IntegrationTests/Helpers/EnvironmentHelper.cs index 5e84229aa6..9cb8891ec8 100644 --- a/test/IntegrationTests/Helpers/EnvironmentHelper.cs +++ b/test/IntegrationTests/Helpers/EnvironmentHelper.cs @@ -256,32 +256,20 @@ public string GetTargetFramework() return $"net{_major}{_minor}{_patch ?? string.Empty}"; } - private static string GetStartupHookOutputPath() + private string GetStartupHookOutputPath() { string startupHookOutputPath = Path.Combine( GetNukeBuildOutput(), "net", "OpenTelemetry.AutoInstrumentation.StartupHook.dll"); - return startupHookOutputPath; - } - - private static string GetSharedStorePath() - { - string storePath = Path.Combine( - GetNukeBuildOutput(), - "store"); - - return storePath; - } - - private static string GetAdditionalDepsPath() - { - string additionalDeps = Path.Combine( - GetNukeBuildOutput(), - "AdditionalDeps"); + if (File.Exists(startupHookOutputPath)) + { + _output?.WriteLine($"Found startup hook at {startupHookOutputPath}."); + return startupHookOutputPath; + } - return additionalDeps; + throw new InvalidOperationException($"Unable to find startup hook at: {startupHookOutputPath}"); } private void SetDefaultEnvironmentVariables() @@ -289,8 +277,6 @@ private void SetDefaultEnvironmentVariables() string profilerPath = GetProfilerPath(); CustomEnvironmentVariables["DOTNET_STARTUP_HOOKS"] = GetStartupHookOutputPath(); - CustomEnvironmentVariables["DOTNET_SHARED_STORE"] = GetSharedStorePath(); - CustomEnvironmentVariables["DOTNET_ADDITIONAL_DEPS"] = GetAdditionalDepsPath(); // call TestHelper.EnableBytecodeInstrumentation() to enable CoreCLR Profiler when bytecode instrumentation is needed // it is not enabled by default to make sure that the instrumentations that do not require CoreCLR Profiler are working without it diff --git a/test/IntegrationTests/Helpers/InstrumentedProcessHelper.cs b/test/IntegrationTests/Helpers/InstrumentedProcessHelper.cs index e7599f908b..5c735f1bbf 100644 --- a/test/IntegrationTests/Helpers/InstrumentedProcessHelper.cs +++ b/test/IntegrationTests/Helpers/InstrumentedProcessHelper.cs @@ -30,6 +30,26 @@ internal static class InstrumentedProcessHelper startInfo.RedirectStandardInput = false; startInfo.StandardOutputEncoding = Encoding.Default; - return Process.Start(startInfo); + // 1. Create the specialized process object + var process = new IntegrationTestProcess + { + StartInfo = startInfo + }; + + // 2. Start it + process.Start(); + + // 3. IMMEDIATELY attach the helper. + // This calls BeginOutputReadLine()/BeginErrorReadLine() + // and prevents the process hang if it has a lot of output that no one reads + process.AttachedHelper = new ProcessHelper(process); + + return process; + } + + internal sealed class IntegrationTestProcess : Process + { + // This holds the helper that is already draining the process + public ProcessHelper? AttachedHelper { get; set; } } } diff --git a/test/IntegrationTests/Helpers/ProcessHelper.cs b/test/IntegrationTests/Helpers/ProcessHelper.cs index e27e00f6db..0866d3c901 100644 --- a/test/IntegrationTests/Helpers/ProcessHelper.cs +++ b/test/IntegrationTests/Helpers/ProcessHelper.cs @@ -26,6 +26,18 @@ public ProcessHelper(Process? process) return; } + // If this is our special process type and it already has a helper... + if (process is InstrumentedProcessHelper.IntegrationTestProcess { AttachedHelper: not null } it) + { + // "Adopt" the state of the existing helper instead of starting a new one + Process = it.AttachedHelper.Process; + _outputBuffer = it.AttachedHelper._outputBuffer; + _errorBuffer = it.AttachedHelper._errorBuffer; + _outputMutex = it.AttachedHelper._outputMutex; + // Note: In this case, don't call BeginOutputReadLine()/BeginErrorReadLine() again! + return; + } + Process = process; Process.OutputDataReceived += (_, e) => DrainOutput(e.Data, _outputBuffer, isErrorStream: false); Process.ErrorDataReceived += (_, e) => DrainOutput(e.Data, _errorBuffer, isErrorStream: true); diff --git a/test/IntegrationTests/WcfCoreServerTestHelper.cs b/test/IntegrationTests/WcfCoreServerTestHelper.cs index 2d52e78c50..8daa2f8f4f 100644 --- a/test/IntegrationTests/WcfCoreServerTestHelper.cs +++ b/test/IntegrationTests/WcfCoreServerTestHelper.cs @@ -36,8 +36,11 @@ internal override (ProcessHelper ProcessHelper, int TcpPort, int HttpPort) RunWc var tcpPort = TcpPortProvider.GetOpenPort(); SetExporter(collector); + // TODO suppress just like in WcfServerTestHelperBase.RunWcfServer; refactor to clarify disposal responsibility +#pragma warning disable CA2000 // Dispose objects before losing scope. var process = InstrumentedProcessHelper.Start(testApplicationPath, $"--tcpPort {tcpPort} --httpPort {httpPort}", EnvironmentHelper); return (new ProcessHelper(process), tcpPort, httpPort); +#pragma warning restore CA2000 // Dispose objects before losing scope. } } #endif diff --git a/test/OpenTelemetry.AutoInstrumentation.Loader.Tests/LoaderTests.cs b/test/OpenTelemetry.AutoInstrumentation.Loader.Tests/LoaderTests.cs index 17428cb207..7709ce8cc2 100644 --- a/test/OpenTelemetry.AutoInstrumentation.Loader.Tests/LoaderTests.cs +++ b/test/OpenTelemetry.AutoInstrumentation.Loader.Tests/LoaderTests.cs @@ -6,21 +6,14 @@ namespace OpenTelemetry.AutoInstrumentation.Loader.Tests; -public class LoaderTests +public class LoaderTests(ITestOutputHelper testOutput) { - private readonly ITestOutputHelper _testOutput; - - public LoaderTests(ITestOutputHelper testOutput) - { - _testOutput = testOutput; - } - [Fact] public void Ctor_LoadsManagedAssembly() { var directory = Directory.GetCurrentDirectory(); var profilerDirectory = Path.Combine(directory, "..", "Profiler"); - _testOutput.WriteLine($"profilerDirectory={profilerDirectory}"); + testOutput.WriteLine($"profilerDirectory={profilerDirectory}"); #if NETFRAMEWORK var srcDir = Path.Combine(profilerDirectory, "net462"); @@ -38,15 +31,13 @@ public void Ctor_LoadsManagedAssembly() Environment.SetEnvironmentVariable("OTEL_LOG_LEVEL", "debug"); Environment.SetEnvironmentVariable("OTEL_DOTNET_AUTO_HOME", profilerDirectory); - var exception = Record.Exception(() => new AutoInstrumentation.Loader.Loader()); + var exception = Record.Exception(() => new Loader()); // That means the assembly was loaded successfully and Initialize method was called. Assert.Null(exception); - var openTelemetryAutoInstrumentationAssembly = AppDomain.CurrentDomain.GetAssemblies() - .Select(a => a.FullName) - .FirstOrDefault(n => n != null && n.StartsWith("OpenTelemetry.AutoInstrumentation,", StringComparison.Ordinal)); - - Assert.NotNull(openTelemetryAutoInstrumentationAssembly); + Assert.Contains( + AppDomain.CurrentDomain.GetAssemblies(), + it => it.FullName?.StartsWith("OpenTelemetry.AutoInstrumentation,", StringComparison.Ordinal) == true); } } diff --git a/test/OpenTelemetry.AutoInstrumentation.Tests/FrameworkDistroTests.cs b/test/OpenTelemetry.AutoInstrumentation.Tests/FrameworkDistroTests.cs new file mode 100644 index 0000000000..af973fcdcb --- /dev/null +++ b/test/OpenTelemetry.AutoInstrumentation.Tests/FrameworkDistroTests.cs @@ -0,0 +1,165 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// This test is defined in NET 9.0 because the tool is written in .NET 9.0 +// The actual test is testing .NET Framework context. +#if NET10_0 + +using System.Reflection; +using System.Runtime.InteropServices; +using DependencyListGenerator; +using Microsoft.Build.Evaluation; +using NuGet.Configuration; +using NuGet.Frameworks; +using Xunit; + +namespace OpenTelemetry.AutoInstrumentation.Tests; + +public class FrameworkDistroTests +{ + private const string AssembliesProjectName = "OpenTelemetry.AutoInstrumentation.Assemblies"; + + [Fact] + public void GeneratorDiscoversTransientDependencies() + { + var currentTestLocation = Assembly.GetExecutingAssembly().Location; + var testDir = FindParentDir(currentTestLocation, "test"); + var srcDir = Path.Combine(Directory.GetParent(testDir)!.FullName, "src"); + var codeDir = Path.Combine(srcDir, AssembliesProjectName); + var projectPath = Path.Combine(codeDir, $"{AssembliesProjectName}.csproj"); + + var frameworkDependencies = Generator.EnumerateDependencies(projectPath); + + // Check that every TFM has 'Microsoft.Extensions.Configuration.Binder' reference. + // We just test one common transient dependency for all + Assert.All(frameworkDependencies, pair => Assert.Contains(pair.Value, it => it.Name == "Microsoft.Extensions.Configuration.Binder")); + } + + [Fact] + public void ValidateTransientDependenciesPackageVersionsDefined() + { + var currentTestLocation = Assembly.GetExecutingAssembly().Location; + var testDir = FindParentDir(currentTestLocation, "test"); + var srcDir = Path.Combine(Directory.GetParent(testDir)!.FullName, "src"); + var codeDir = Path.Combine(srcDir, AssembliesProjectName); + var projectPath = Path.Combine(codeDir, $"{AssembliesProjectName}.csproj"); + var packagesPath = Path.Combine(codeDir, "Directory.Packages.props"); + + var frameworkDependencies = Generator.EnumerateDependencies(projectPath); + + // We use "15.0" as toolkit version, it should be replaced with "Current" + // when Microsoft.Build will be updated. + const string toolsVersion = "15.0"; + + Assert.All(frameworkDependencies, pair => + { + using var collection = new ProjectCollection(); + // MSBuild needs both TargetFramework (e.g., "net462") and TargetFrameworkIdentifier (e.g., ".NETFramework") + // because Directory.Packages.props uses both conditions to include + // framework-specific package versions. + var properties = new Dictionary + { + { "TargetFramework", pair.Key }, + { "TargetFrameworkIdentifier", NuGetFramework.Parse(pair.Key).Framework } + }; + var project = new Project(packagesPath, properties, toolsVersion, collection); + + var versionedDependencies = project.Items + .Where(it => it.ItemType == "PackageVersion") + .Select(it => it.EvaluatedInclude) + .ToHashSet(); + + Assert.All(pair.Value, dep => Assert.Contains(dep.Name, versionedDependencies)); + }); + } + + [SkippableFact] + public void ReferencedPackagesNoUnsupportedNetFramework() + { + Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), ".NET Framework is supported only on Windows."); + + var currentTestLocation = Assembly.GetExecutingAssembly().Location; + var testDir = FindParentDir(currentTestLocation, "test"); + var srcDir = Path.Combine(Directory.GetParent(testDir)!.FullName, "src"); + var codeDir = Path.Combine(srcDir, AssembliesProjectName); + var projectPath = Path.Combine(codeDir, $"{AssembliesProjectName}.csproj"); + + var dependencies = Generator.EnumerateDependencies(projectPath).SelectMany(it => it.Value).ToHashSet(); + var packagesFolder = SettingsUtility.GetGlobalPackagesFolder(Settings.LoadDefaultSettings(root: codeDir)); + + string[] supportedFrameworkTfmPrefixes = ["net40", "net45", "net46", "net47"]; + + // We may need add new TFM in OpenTelemetry.AutoInstrumentation.Assemblies + // (and build infrastructure, readme) if referenced dependencies has a custom build for that TFM. + Assert.All(dependencies, dependency => + { + var packageFolder = Path.Combine(packagesFolder, dependency.Name, dependency.Version); + + // Check .NET Framework TFMs + var net4Files = Directory.EnumerateDirectories(packageFolder, "net4*", SearchOption.AllDirectories) + .Select(Path.GetFileName) + .Cast(); + + Assert.All(net4Files, file => + Assert.True( + file.Contains('.', StringComparison.Ordinal) || + supportedFrameworkTfmPrefixes.Any(prefix => file.StartsWith(prefix, StringComparison.Ordinal)), + $"Package {dependency.Name} v{dependency.Version} contains unsupported .NET Framework TFM '{file}'")); + }); + } + + // TODO investigate failure on Linux and switch to [Fact] + // Example error (all 76 dependencies has the same error) + // Error: Could not find a part of the path '/home/runner/work/opentelemetry-dotnet-instrumentation/opentelemetry-dotnet-instrumentation/packages/Microsoft.Extensions.Configuration/10.0.2'. + [SkippableFact] + public void ReferencedPackagesNoUnsupportedNet() + { + Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Investigate why fails on Linux"); + + var currentTestLocation = Assembly.GetExecutingAssembly().Location; + var testDir = FindParentDir(currentTestLocation, "test"); + var srcDir = Path.Combine(Directory.GetParent(testDir)!.FullName, "src"); + var codeDir = Path.Combine(srcDir, AssembliesProjectName); + var projectPath = Path.Combine(codeDir, $"{AssembliesProjectName}.csproj"); + + var dependencies = Generator.EnumerateDependencies(projectPath).SelectMany(it => it.Value).ToHashSet(); + var packagesFolder = SettingsUtility.GetGlobalPackagesFolder(Settings.LoadDefaultSettings(root: codeDir)); + + string[] supportedCoreTfmPrefixes = ["netcoreapp", "netstandard", "net5", "net6", "net7", "net8", "net9", "net10"]; + + // We may need add new TFM in OpenTelemetry.AutoInstrumentation.Assemblies + // (and build infrastructure, readme) if referenced dependencies has a custom build for that TFM. + Assert.All(dependencies, dependency => + { + var packageFolder = Path.Combine(packagesFolder, dependency.Name, dependency.Version); + + // Check .NET Core+ TFMs (netcoreapp*, netstandard*, net5.0+) + var netCoreAppFiles = Directory.EnumerateDirectories(packageFolder, "netcoreapp*", SearchOption.AllDirectories); + var netStandardFiles = Directory.EnumerateDirectories(packageFolder, "netstandard*", SearchOption.AllDirectories); + // Range(5, 6) generates versions 5 through 10 (start=5, count=6) + var net5PlusFiles = Enumerable.Range(5, 6) + .SelectMany(version => Directory.EnumerateDirectories(packageFolder, $"net{version}.*", SearchOption.AllDirectories)); + + var netCoreFiles = netCoreAppFiles + .Concat(netStandardFiles) + .Concat(net5PlusFiles) + .Select(Path.GetFileName) + .Cast(); + + Assert.All(netCoreFiles, file => + Assert.True( + file.Contains('.', StringComparison.Ordinal) || + supportedCoreTfmPrefixes.Any(prefix => file.StartsWith(prefix, StringComparison.Ordinal)), + $"Package {dependency.Name} v{dependency.Version} contains unsupported .NET Core/Standard TFM '{file}'")); + }); + } + + private static string FindParentDir(string location, string parentName) + => Directory.GetParent(location) switch + { + null => throw new InvalidOperationException("Could not find parent test directory"), + var parent when parent.Name == parentName => parent.FullName, + var parent => FindParentDir(parent.FullName, parentName) + }; +} +#endif diff --git a/test/OpenTelemetry.AutoInstrumentation.Tests/NetFrameworkDistroTests.cs b/test/OpenTelemetry.AutoInstrumentation.Tests/NetFrameworkDistroTests.cs deleted file mode 100644 index 92dedd42b6..0000000000 --- a/test/OpenTelemetry.AutoInstrumentation.Tests/NetFrameworkDistroTests.cs +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// This test is defined in NET 9.0 because the tool is written in .NET 9.0 -// The actual test is testing .NET Framework context. -#if NET10_0 - -using System.Reflection; -using System.Runtime.InteropServices; -using DependencyListGenerator; -using NuGet.Configuration; -using Xunit; -using Xunit.Abstractions; - -namespace OpenTelemetry.AutoInstrumentation.Tests; - -public class NetFrameworkDistroTests -{ - private readonly ITestOutputHelper _output; - - public NetFrameworkDistroTests(ITestOutputHelper output) - { - _output = output; - } - - [SkippableFact] - public void GeneratorDiscoversTransientDependencies() - { - Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Supported only on Windows."); - - var currentTestLocation = Assembly.GetExecutingAssembly().Location; - var testDir = FindParentDir(currentTestLocation, "test"); - var srcDir = Path.Combine(Directory.GetParent(testDir)!.FullName, "src"); - var codeDir = Path.Combine(srcDir, "OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework"); - var projectPath = Path.Combine(codeDir, "OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework.csproj"); - - var dependencies = Generator.EnumerateDependencies(projectPath); - - // Check that every TFM has System.Memory reference. We just selected one transient dependency to test. - Assert.True(dependencies.All(tfm => tfm.Value.Any(dep => dep.Name == "System.Memory"))); - } - - [SkippableFact] - public void ValidateTransientDependenciesPackageVersionsDefined() - { - Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Supported only on Windows."); - - var currentTestLocation = Assembly.GetExecutingAssembly().Location; - var testDir = FindParentDir(currentTestLocation, "test"); - var srcDir = Path.Combine(Directory.GetParent(testDir)!.FullName, "src"); - var codeDir = Path.Combine(srcDir, "OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework"); - var projectPath = Path.Combine(codeDir, "OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework.csproj"); - var packagesPath = Path.Combine(codeDir, "Directory.Packages.props"); - - var discoveredDependencies = Generator.EnumerateDependencies(projectPath); - - List<(string Package, string Tfm)> undefinedDependencies = new(); - - foreach (var tfmDependencies in discoveredDependencies) - { - using var collection = new Microsoft.Build.Evaluation.ProjectCollection(); - // We use "15.0" as toolkit version, it should be replaced with "Current" - // when Microsoft.Build will be updated. - var project = - new Microsoft.Build.Evaluation.Project( - Path.Combine(Path.GetDirectoryName(packagesPath)!, "Directory.Packages.props"), - new Dictionary { ["TargetFramework"] = tfmDependencies.Key }, - "15.0", - collection); - - var definedVersions = project - .Items.Where(it => it.ItemType == "PackageVersion").ToDictionary(item => item.EvaluatedInclude, item => item.GetMetadata("Version")); - - undefinedDependencies.AddRange(tfmDependencies.Value.Where(dep => !definedVersions.ContainsKey(dep.Name)).Select(dep => (dep.Name, tfmDependencies.Key))); - } - - Assert.Empty(undefinedDependencies); - } - - [SkippableFact] - public void ReferencedPackagesNoUnsupportedTfm() - { - Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Supported only on Windows."); - - var currentTestLocation = Assembly.GetExecutingAssembly().Location; - var testDir = FindParentDir(currentTestLocation, "test"); - var srcDir = Path.Combine(Directory.GetParent(testDir)!.FullName, "src"); - var codeDir = Path.Combine(srcDir, "OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework"); - var projectPath = Path.Combine(codeDir, "OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework.csproj"); - - var dependencies = Generator.EnumerateDependencies(projectPath).SelectMany(tfm => tfm.Value).ToHashSet(); - - var packagesFolder = - SettingsUtility.GetGlobalPackagesFolder( - Settings.LoadDefaultSettings(root: codeDir)); - - string[] knownOldPrefix = ["net40", "net45", "net46", "net47"]; - List unexpectedFrameworkFolders = []; - foreach (var dependency in dependencies) - { - var packageFolder = Path.Combine(packagesFolder, dependency.Name, dependency.Version); - foreach (var folder in Directory.EnumerateDirectories(packageFolder, "net4*", SearchOption.AllDirectories)) - { - var tfm = Path.GetFileName(folder); - if (tfm.Contains('.', StringComparison.Ordinal)) - { - // .NET 40.x - continue; - } - - if (knownOldPrefix.Any(prefix => tfm.StartsWith(prefix, StringComparison.Ordinal))) - { - continue; - } - - var path = Path.GetRelativePath(packagesFolder, folder); - unexpectedFrameworkFolders.Add(path); - _output.WriteLine($"Unexpected TFM: {path}"); - } - } - - // We may need add new TFM in OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework - // (and build infrastructure, readme) if referenced dependencies has a custom build for that TFM. - Assert.Empty(unexpectedFrameworkFolders); - } - - private static string FindParentDir(string location, string parentName) - { - var parent = Directory.GetParent(location); - if (parent == null) - { - throw new InvalidOperationException("Could not find parent test directory"); - } - - if (parent.Name == parentName) - { - return parent.FullName; - } - - return FindParentDir(parent.FullName, parentName); - } -} -#endif diff --git a/test/test-applications/integrations/TestApplication.ContinuousProfiler.ContextTracking/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.ContinuousProfiler.ContextTracking/Properties/launchSettings.json index 63b485b230..160e25cb7b 100644 --- a/test/test-applications/integrations/TestApplication.ContinuousProfiler.ContextTracking/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.ContinuousProfiler.ContextTracking/Properties/launchSettings.json @@ -7,8 +7,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_DOTNET_AUTO_PLUGINS": "TestApplication.ContinuousProfiler.ContextTracking.TestPlugin, TestApplication.ContinuousProfiler.ContextTracking, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", diff --git a/test/test-applications/integrations/TestApplication.ContinuousProfiler/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.ContinuousProfiler/Properties/launchSettings.json index c4b0169e76..1948ab81ed 100644 --- a/test/test-applications/integrations/TestApplication.ContinuousProfiler/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.ContinuousProfiler/Properties/launchSettings.json @@ -8,8 +8,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_DOTNET_AUTO_PLUGINS": "TestApplication.ContinuousProfiler.ThreadPlugin, TestApplication.ContinuousProfiler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", // or "TestApplication.ContinuousProfiler.AllocationPlugin, TestApplication.ContinuousProfiler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" for allocation testing purposes diff --git a/test/test-applications/integrations/TestApplication.Http/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.Http/Properties/launchSettings.json index 4203cf52c2..6e874389fc 100644 --- a/test/test-applications/integrations/TestApplication.Http/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.Http/Properties/launchSettings.json @@ -11,9 +11,7 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps" + "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll" }, "applicationUrl": "https://localhost:51356;http://localhost:51357" } diff --git a/test/test-applications/integrations/TestApplication.Kafka/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.Kafka/Properties/launchSettings.json index a60ae3eff5..b3c315f7de 100644 --- a/test/test-applications/integrations/TestApplication.Kafka/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.Kafka/Properties/launchSettings.json @@ -11,8 +11,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_SERVICE_NAME": "TestApplication.Kafka", diff --git a/test/test-applications/integrations/TestApplication.Log4NetBridge/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.Log4NetBridge/Properties/launchSettings.json index 4a6451abb5..463e3b8971 100644 --- a/test/test-applications/integrations/TestApplication.Log4NetBridge/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.Log4NetBridge/Properties/launchSettings.json @@ -11,8 +11,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_SERVICE_NAME": "TestApplication.Log4NetBridge", diff --git a/test/test-applications/integrations/TestApplication.MassTransit/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.MassTransit/Properties/launchSettings.json index 1a478a9d09..97e64051b8 100644 --- a/test/test-applications/integrations/TestApplication.MassTransit/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.MassTransit/Properties/launchSettings.json @@ -11,8 +11,6 @@ "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", "OTEL_TRACES_EXPORTER": "zipkin,console", "OTEL_EXPORTER_ZIPKIN_ENDPOINT": "http://127.0.0.1:9411/api/v2/spans", "OTEL_LOG_LEVEL": "debug", diff --git a/test/test-applications/integrations/TestApplication.MinimalApi/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.MinimalApi/Properties/launchSettings.json index accb621259..43679a25f1 100644 --- a/test/test-applications/integrations/TestApplication.MinimalApi/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.MinimalApi/Properties/launchSettings.json @@ -35,8 +35,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_LOGS_EXPORTER": "otlp,console" diff --git a/test/test-applications/integrations/TestApplication.MongoDB/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.MongoDB/Properties/launchSettings.json index df473d23dc..0e9e707865 100644 --- a/test/test-applications/integrations/TestApplication.MongoDB/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.MongoDB/Properties/launchSettings.json @@ -8,8 +8,6 @@ "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", "OTEL_TRACES_EXPORTER": "console,zipkin,otlp", "OTEL_EXPORTER_ZIPKIN_ENDPOINT": "http://localhost:9411/api/v2/spans", "OTEL_LOG_LEVEL": "debug", diff --git a/test/test-applications/integrations/TestApplication.NServiceBus/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.NServiceBus/Properties/launchSettings.json index 45f36fbf3f..865bb7c59d 100644 --- a/test/test-applications/integrations/TestApplication.NServiceBus/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.NServiceBus/Properties/launchSettings.json @@ -10,8 +10,6 @@ "COR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "COR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", "OTEL_TRACES_EXPORTER": "zipkin,console", "OTEL_EXPORTER_ZIPKIN_ENDPOINT": "http://127.0.0.1:9411/api/v2/spans", "OTEL_LOG_LEVEL": "debug", diff --git a/test/test-applications/integrations/TestApplication.NoCode/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.NoCode/Properties/launchSettings.json index a8acfea733..6407b1892c 100644 --- a/test/test-applications/integrations/TestApplication.NoCode/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.NoCode/Properties/launchSettings.json @@ -11,8 +11,6 @@ "COR_ENABLE_PROFILING": "1", "COR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "COR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_TRACES_EXPORTER": "otlp,console", diff --git a/test/test-applications/integrations/TestApplication.ProfilerSpanStoppageHandling/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.ProfilerSpanStoppageHandling/Properties/launchSettings.json index f088e52218..2a34bb66fa 100644 --- a/test/test-applications/integrations/TestApplication.ProfilerSpanStoppageHandling/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.ProfilerSpanStoppageHandling/Properties/launchSettings.json @@ -7,8 +7,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_DOTNET_AUTO_PLUGINS": "TestApplication.SelectiveSampler.Plugins.MixedModeSamplingPlugin, TestApplication.ProfilerSpanStoppageHandling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", diff --git a/test/test-applications/integrations/TestApplication.RabbitMq/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.RabbitMq/Properties/launchSettings.json index 40f903cad6..df8e3212ff 100644 --- a/test/test-applications/integrations/TestApplication.RabbitMq/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.RabbitMq/Properties/launchSettings.json @@ -10,8 +10,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_SERVICE_NAME": "TestApplication.RabbitMq", diff --git a/test/test-applications/integrations/TestApplication.SelectiveSampler/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.SelectiveSampler/Properties/launchSettings.json index d09ed8ba5e..0572f74249 100644 --- a/test/test-applications/integrations/TestApplication.SelectiveSampler/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.SelectiveSampler/Properties/launchSettings.json @@ -7,8 +7,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_DOTNET_AUTO_PLUGINS": "TestApplication.SelectiveSampler.Plugins.SelectiveSamplerPlugin, TestApplication.SelectiveSampler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", diff --git a/test/test-applications/integrations/TestApplication.Worker/Properties/launchSettings.json b/test/test-applications/integrations/TestApplication.Worker/Properties/launchSettings.json index a6dc47a61b..eac9d4755e 100644 --- a/test/test-applications/integrations/TestApplication.Worker/Properties/launchSettings.json +++ b/test/test-applications/integrations/TestApplication.Worker/Properties/launchSettings.json @@ -8,8 +8,6 @@ "CORECLR_ENABLE_PROFILING": "1", "CORECLR_PROFILER": "{918728DD-259F-4A6A-AC2B-B85E1B658318}", "CORECLR_PROFILER_PATH": "$(SolutionDir)bin\\tracer-home\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll", - "DOTNET_ADDITIONAL_DEPS": "$(SolutionDir)bin\\tracer-home\\AdditionalDeps", - "DOTNET_SHARED_STORE": "$(SolutionDir)bin\\tracer-home\\store", "DOTNET_STARTUP_HOOKS": "$(SolutionDir)bin\\tracer-home\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll", "OTEL_DOTNET_AUTO_HOME": "$(SolutionDir)bin\\tracer-home", "OTEL_LOGS_EXPORTER": "otlp,console" diff --git a/tools/DependencyListGenerator/DotNetOutdated/Services/DotNetRunner.cs b/tools/DependencyListGenerator/DotNetOutdated/Services/DotNetRunner.cs index 0566d12857..054c85d8d7 100644 --- a/tools/DependencyListGenerator/DotNetOutdated/Services/DotNetRunner.cs +++ b/tools/DependencyListGenerator/DotNetOutdated/Services/DotNetRunner.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.IO; using System.Text; using McMaster.Extensions.CommandLineUtils; @@ -11,7 +12,18 @@ public static class DotNetRunner { public static RunStatus Run(string workingDirectory, string[] arguments) { - var psi = new ProcessStartInfo(DotNetExe.FullPathOrDefault(), string.Join(" ", arguments)) + // 1. Get the path from the library + var dotnetPath = DotNetExe.FullPathOrDefault(); + + // 2. Check if the file actually exists. If not, just use "dotnet" + // and let the OS find it in the PATH. + // on Linux DotNetExe.FullPathOrDefault() may wrongly return "/usr/local/share/dotnet/dotnet" + if (dotnetPath == null || !File.Exists(dotnetPath)) + { + dotnetPath = "dotnet"; + } + + var psi = new ProcessStartInfo(dotnetPath, string.Join(" ", arguments)) { WorkingDirectory = workingDirectory, UseShellExecute = false,