microsoft / microsoft/CLRInstrumentationEngine

Extensions.Base can't support System.Func`10+

Open
#559 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
102
Forks
52
Avg merge
13h 11m
Merged PRs (30d)
6

Description

Related PRs:
https://github.com/microsoft/CLRInstrumentationEngine/pull/463
https://github.com/microsoft/CLRInstrumentationEngine/pull/557

During OnModuleLoad for mscorlib.dll, HostExtensionsBase tries to inject the types/methods from Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll into mscorlib.

The Extensions.Base.dll module contains the ApplicationInsights_OnBegin/_OnEnd callbacks that use System.Func and other types.
It also defines these callbacks inside the _System.Diagnostics namespace - types with _ prefixes are emitted into mscorlib (otherwise they are assumed to be there already.

The import will fail when resolving types like System.Func`10 since that comes from System.Core.dll which requires a TypeRef - not allowed in mscorlib.

One solution might be to have the System.Func`10+ callbacks defined separately and imported into System.Core.dll, but there might also be changes needed in Intercept-Engine to consume that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with HostExtensionsBase during OnModuleLoad for mscorlib.dll and the import logic for Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll. Review the related PRs #463 and #557, then determine how System.Func`10 and other System.Core types should be made available without invalid TypeRefs in mscorlib; done means the import succeeds for these callbacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.