Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Datadog.Trace.sln
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.GraphQL4", "tracer\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Elasticsearch.V7", "tracer\test\test-applications\integrations\Samples.Elasticsearch.V7\Samples.Elasticsearch.V7.csproj", "{3CB0B2C2-7664-4D71-8F43-3D207EE80DB7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnumerateAssemblyReferences", "tracer\test\test-applications\regression\EnumerateAssemblyReferences\EnumerateAssemblyReferences.csproj", "{B22311CE-EC71-4ADD-ADC6-C466B2D10230}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1764,6 +1766,16 @@ Global
{3CB0B2C2-7664-4D71-8F43-3D207EE80DB7}.Release|x64.Build.0 = Release|x64
{3CB0B2C2-7664-4D71-8F43-3D207EE80DB7}.Release|x86.ActiveCfg = Release|x86
{3CB0B2C2-7664-4D71-8F43-3D207EE80DB7}.Release|x86.Build.0 = Release|x86
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Debug|Any CPU.ActiveCfg = Debug|x86
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Debug|x64.ActiveCfg = Debug|x64
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Debug|x64.Build.0 = Debug|x64
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Debug|x86.ActiveCfg = Debug|x86
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Debug|x86.Build.0 = Debug|x86
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Release|Any CPU.ActiveCfg = Release|x86
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Release|x64.ActiveCfg = Release|x64
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Release|x64.Build.0 = Release|x64
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Release|x86.ActiveCfg = Release|x86
{B22311CE-EC71-4ADD-ADC6-C466B2D10230}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1907,6 +1919,7 @@ Global
{CA3D605F-8DD7-4041-B024-70A24036AFA1} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{DA81EF3E-FDB3-417F-AA20-60FC495E3596} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{3CB0B2C2-7664-4D71-8F43-3D207EE80DB7} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
{B22311CE-EC71-4ADD-ADC6-C466B2D10230} = {498A300E-D036-49B7-A43D-821D1CAF11A5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F}
Expand Down
6 changes: 3 additions & 3 deletions tracer/src/Datadog.Trace.ClrProfiler.Native/clr_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ HRESULT GetCorLibAssemblyRef(const ComPtr<IMetaDataAssemblyEmit>& assembly_emit,
Logger::Debug("Using existing corlib reference: ", corAssemblyProperty.szName);
return assembly_emit->DefineAssemblyRef(corAssemblyProperty.ppbPublicKey, corAssemblyProperty.pcbPublicKey,
corAssemblyProperty.szName.c_str(), &corAssemblyProperty.pMetaData,
NULL, 0, 0, corlib_ref);
NULL, 0, corAssemblyProperty.assemblyFlags, corlib_ref);
}
else
{
Expand All @@ -757,8 +757,8 @@ HRESULT GetCorLibAssemblyRef(const ComPtr<IMetaDataAssemblyEmit>& assembly_emit,
metadata.usBuildNumber = 0;
metadata.usRevisionNumber = 0;
BYTE public_key[] = {0xB7, 0x7A, 0x5C, 0x56, 0x19, 0x34, 0xE0, 0x89};
return assembly_emit->DefineAssemblyRef(public_key, sizeof(public_key), WStr("mscorlib"), &metadata, NULL, 0, 0,
corlib_ref);
return assembly_emit->DefineAssemblyRef(public_key, sizeof(public_key), WStr("mscorlib"), &metadata, NULL, 0,
corAssemblyProperty.assemblyFlags, corlib_ref);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// <copyright file="EnumerateAssemblyReferencesTest.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using Xunit;
using Xunit.Abstractions;

namespace Datadog.Trace.ClrProfiler.IntegrationTests.SmokeTests
{
public class EnumerateAssemblyReferencesTest : SmokeTestBase
{
public EnumerateAssemblyReferencesTest(ITestOutputHelper output)
: base(output, "EnumerateAssemblyReferences")
{
}

[Fact]
[Trait("Category", "Smoke")]
public void NoExceptions()
{
CheckForSmoke(shouldDeserializeTraces: false);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LoadManagedProfilerFromProfilerDirectory>true</LoadManagedProfilerFromProfilerDirectory>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;

namespace EnumerateAssemblyReferences
{
public class Program
{
public static void Main()
{
// We define a reference to mscorlib when injecting the startup hook
// If the reference is incorrect, then the following code will throw
var referencedAssemblies = typeof(Program).Assembly.GetReferencedAssemblies();

var names = string.Empty;

foreach (var assembly in referencedAssemblies)
{
names += assembly.FullName + Environment.NewLine;
}

Console.WriteLine(names);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"profiles": {
"EnumerateAssemblyReferences": {
"commandName": "Project",
"nativeDebugging": true,
"environmentVariables": {
"COR_ENABLE_PROFILING": "1",
"COR_PROFILER": "{846F5F1C-F9AE-4B07-969E-05C26BC060D8}",
"COR_PROFILER_PATH": "$(ProjectDir)$(OutputPath)profiler-lib\\Datadog.Trace.ClrProfiler.Native.dll",

"CORECLR_ENABLE_PROFILING": "1",
"CORECLR_PROFILER": "{846F5F1C-F9AE-4B07-969E-05C26BC060D8}",
"CORECLR_PROFILER_PATH": "$(ProjectDir)$(OutputPath)profiler-lib\\Datadog.Trace.ClrProfiler.Native.dll",

"DD_DOTNET_TRACER_HOME": "$(ProjectDir)$(OutputPath)profiler-lib",
"DD_INTEGRATIONS": "$(ProjectDir)$(OutputPath)profiler-lib\\integrations.json"
}
}
}
}