Skip to content

Commit

Permalink
Log an error message when the profiler is loaded multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingosse committed Jan 6, 2025
1 parent af2669f commit a497c39
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tracer/src/Datadog.Tracer.Native/cor_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ HRESULT STDMETHODCALLTYPE CorProfiler::Initialize(IUnknown* cor_profiler_info_un
Logger::EnableDebug(true);
}

if (profiler != nullptr)
{
Logger::Error("The Tracer Profiler is initialized multiple times. This may cause unpredictable failures.",
" When running aspnetcore in IIS, make sure to disable managed code in the application pool settings.",
" https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/advanced?view=aspnetcore-9.0#create-the-iis-site");
}

CorProfilerBase::Initialize(cor_profiler_info_unknown);

// we used to bail-out if tracing was disabled, but we now allow the tracer to be loaded
Expand Down

0 comments on commit a497c39

Please sign in to comment.