Skip to content

aspnetcore on linux-arm64, crash on startup "Could not load file or assembly Datadog.Trace" #6425

Open
@gfody

Description

@gfody

Describe the bug
I'm trying to use Datadog.Trace.Bundle to simplify my deployment process, but my site crashes on startup with:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Datadog.Trace, Version=3.6.1.0, Culture=neutral, PublicKeyToken=def86d061d0d2eeb'. The system cannot find the file specified.
File name: 'Datadog.Trace, Version=3.6.1.0, Culture=neutral, PublicKeyToken=def86d061d0d2eeb'

To Reproduce
Steps to reproduce the behavior:

I followed the examples from here and setup my environment like so:

CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
CORECLR_PROFILER_PATH=/myapp/datadog/linux-arm64/Datadog.Trace.ClrProfiler.Native.so
DD_DOTNET_TRACER_HOME=/myapp/datadog
DD_LOGS_DIRECT_SUBMISSION_INTEGRATIONS=Serilog

my project targets net8.0 and has these packagerefs

    <PackageReference Include="Datadog.Trace.Bundle" Version="3.6.1" />
    <PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
    <PackageReference Include="Serilog.Sinks.Datadog.Logs" Version="0.5.4" />

my initialization looks like this:

    Tracer.Configure(TracerSettings.FromDefaultSources());

    builder.Services.AddLogging(config =>
        config.AddSerilog(new LoggerConfiguration().WriteTo.DatadogLogs(apiKey).CreateLogger()));

    var app = builder.Build();

the new LoggerConfiguration() triggers the FileNotFoundException

if I copy the files from of /myapp/datadog/net6.0 and /myapp/datadog/linux-arm64 into /myapp then it starts and works fine

Expected behavior
site should just work?

Runtime environment (please complete the following information):

  • Instrumentation mode: manual with NuGet package
  • Tracer version: 3.6.1
  • OS: amazon linux 2023
  • CLR: net8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions