diff --git a/tracer/src/Datadog.Tracer.Native/cor_profiler.cpp b/tracer/src/Datadog.Tracer.Native/cor_profiler.cpp index d9c69641405a..1ec8d07a80d8 100644 --- a/tracer/src/Datadog.Tracer.Native/cor_profiler.cpp +++ b/tracer/src/Datadog.Tracer.Native/cor_profiler.cpp @@ -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