Skip to content

Rejit not working under .NET Core #572

@weltkante

Description

@weltkante

I have an instrumentation method that requires rejit during runtime to rewrite specified target methods (inject instrumentation calls) and it works under Desktop Framework, but when running under .NET Core (tested with 7 and 8rc) the rejit call doesn't seem to do anything. Unlike when running under Desktop Framework I'm not given the chance to rewrite the target IL, ShouldInstrumentMethod is never called, .NET Core simply seems to not react on the rejit request (but it doesn't generate an error either).

If the method to be instrumented hasn't been called yet (and thus no rejit is required) my instrumentation works as expected, only the case where the subject method already got called before I do the rejit request doesn't work. I've tried making sure inlining is not a problem by annotating the method accordingly and in Desktop Framework I'm getting ShouldInstrumentMethod with isRejit=true parameter as expected.

Do you have any suggestions how to proceed diagnosing the issue? There is very little information and examples about rejit available. The NaglerInstrumentationMethod just calls it during OnModuleLoaded (which seems a weird place to test rejit functionality since at that point nothing has been jitted yet?)

If you don't have any suggestions or references for me to look at I can start building a standalone repro to post, but that will take a while, so I'm hoping there is more I can check on my own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions