You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is profiler ReJIT of runtime-async method bodies intended to be supported on .NET 11 (preview 4)? #128944
I am writing a small profiler that inserts IL code at beginning and end of certain methods.
It can do that at startup (in ModuleLoadFinished) or during runtime after specific triggers happen - triggering a rejit.
I have observed that the rejit variant does not work anymore as soon as the target method is a runtime async method -
but only if the method in question was already called before. (and therefore was jitted I guess)
I can confirm that the startup version is still working as intended.
The rejit is triggered using RequestReJITWithInliners, also COR_PRF_DISABLE_INLINING was set while testing.
While everything seems to work normally, the modified code just doesn't get applied.
Behavior after calling RequestReJITWithInliners:
RequestReJITWithInliners returns S_OK
GetReJITParameters gets called, call to SetILFunctionBody returns S_OK
Hey, I put together a minimal self-contained reproducer, see the attached zip.
It's a small C++ profiler + C# app that makes the problem immediately visible:
.\run.ps1 before - ReJIT applied before the first call -> works, injected IL runs
.\run.ps1 after - ReJIT applied after the method was already called -> silently does nothing; the profiler log shows RequestReJITWithInliners -> OK, SetILFunctionBody -> OK, ReJITCompilationFinished -> hrStatus=0 but the original code keeps running
Requires DOTNET_RuntimeAsync=1 (set by the script), .NET SDK 11.0.100-preview.4, CMake, and VS 2022. .\build.ps1 then .\run.ps1 before|after.
Activity
dotnet-policy-service commentedon Jun 3, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Jun 4, 2026
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.
birnbeidla commentedon Jun 12, 2026
I ran the same tests on preview 5 with the same result.
Agentic research suggests that thunks are not updated on rejit. (Although I'm not sure how much I can rely on that)
Any thoughts though? Any comments from other people that have tested profiler rejit?
omerkoskas commentedon Jul 1, 2026
Hey, I'm noticing this issue as well, any news here?
hans-juergenkleeber commentedon Jul 2, 2026
Hey, I put together a minimal self-contained reproducer, see the attached zip.
It's a small C++ profiler + C# app that makes the problem immediately visible:
Requires DOTNET_RuntimeAsync=1 (set by the script), .NET SDK 11.0.100-preview.4, CMake, and VS 2022. .\build.ps1 then .\run.ps1 before|after.
simple-runtime-async-rejit.zip
Fix profiler ReJIT of Runtime Async method bodies (#131681)