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

AutoInstrumentation assembly not loaded as domain-neutral #3860

Open
lipingma opened this issue Dec 5, 2024 · 3 comments
Open

AutoInstrumentation assembly not loaded as domain-neutral #3860

lipingma opened this issue Dec 5, 2024 · 3 comments

Comments

@lipingma
Copy link

lipingma commented Dec 5, 2024

Bug Report

I'm trying to inject the opentelemetry-dotnet-instrumentation to Powershell.

The powershell assembly is loaded to domain-neutral but the AutoInstrumentation.Loader and AutoInstrumentation was loaded to the default domain.

ModuleLoadFinished: 140718829523560 Microsoft.PowerShell.ConsoleHost AppDomain 140720438070400 [EE Shared Assembly Repository]  | IsNGEN = false | IsDynamic = false | IsResource = false

ModuleLoadFinished: opentelemetry.AutoInstrumentation.Loader loaded into AppDomain 2381253564688 [DefaultDomain]

Which casued the problem:

[warning] *** CallTarget_RewriterCallback() skipping method: Method replacement found but the managed profiler has not yet been loaded into AppDomain with id=140720438070400 token=100684843 caller_name=System.Management.Automation.Runspaces.RunspaceBase.Open()

The team have fixed before: #1134 (comment)

Is this expected?
After I have registered the AutoInstrumentation.Loader and AutoInstrumentation assembly to the AGC, the problem resolved, but it this the expected way to fix it?

@lipingma
Copy link
Author

Hi, @Kielek , could you help clarify here?

@Kielek
Copy link
Contributor

Kielek commented Dec 10, 2024

@lipingma, do you have some time to prepare exact steps you are doing?
It is usually called Minimal, Reproducible Example. Executing code in a reproducible context - like docker image + scripts you are doing can be really helpful, and at least reduce time to figure out what your are trying to achieve.

@RassK
Copy link
Contributor

RassK commented Dec 19, 2024

@lipingma how did you setup it first? The PowerShell install module loads these anyway to GAC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants