Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Dotnet profiler auto instrument not working #2532

Open
ysj2018 opened this issue Dec 16, 2024 · 0 comments
Open

[BUG] Dotnet profiler auto instrument not working #2532

ysj2018 opened this issue Dec 16, 2024 · 0 comments
Labels
bug Something isn't working community triage

Comments

@ysj2018
Copy link

ysj2018 commented Dec 16, 2024

I would like to use dotnet Profiler Auto instrumentation to probe my test application developed based on the .NET Framework, but it's not working.

Details about my application:

The test application is developed using .NET Framework 4.8.1.
It runs normally and functions correctly.
Details about my computer:

My computer's operating system is Windows 11.
The pre-installed .NET Framework version on my computer is 4.8.
Details about my development environment:

I use Rider 2024 as my development tool.
When creating the project, the target framework selected was 4.8.1.
When building the project, v4.0 was chosen.
For publishing, I chose a local folder.
I packaged and published the project on IIS and configured environment variables with the script as follows:

$appcmd = "$($env:systemroot)\system32\inetsrv\AppCmd.exe"
$appPool = "test"
$profilerHomeDir = "D:\IIS\agent\agent"
$environment = @{
COR_ENABLE_PROFILING = "1"
COR_PROFILER = "{FA65FE15-F085-4681-9B20-95E04F6C03CC}"
COR_PROFILER_PATH = "$profilerHomeDir\elastic_apm_profiler.dll"
ELASTIC_APM_PROFILER_HOME = "$profilerHomeDir"
ELASTIC_APM_PROFILER_INTEGRATIONS = "$profilerHomeDir\integrations.yml"
COMPlus_LoaderOptimization = "1"
ELASTIC_APM_SERVER_URL = "http://localhost:8200"
ELASTIC_APM_SERVICE_NAME = "dotnettest"
}
$environment.Keys | ForEach-Object {
& $appcmd set config -section:system.applicationHost/applicationPools /+"[name='$appPool'].environmentVariables.[name='$',value='$($environment[$])']"
}

The project runs normally, but the profiler did not successfully attach.

An error was found in the Event Viewer: "NET Runtime version 4.0.30319.0 - Failed to load profiler during CoCreateInstance. Profiler CLSID: '{FA65FE15-F085-4681-9B20-95E04F6C03CC}'. HRESULT: 0x800700c1. Process ID (decimal): 26524. Message ID: [0x2504]."

What could be the possible reasons for this?

@ysj2018 ysj2018 added the bug Something isn't working label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community triage
Projects
None yet
Development

No branches or pull requests

1 participant