microsoft / CLRInstrumentationEngine

The CLR Instrumentation Engine is a cooperation profiler that allows running multiple profiling extensions in the same process.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

WilliamXieMSFT opened this issue · comments

Related PRs:
#463
#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.