Identify ready2run image #38440
-
Hi! Is there a way of identifying that my app is running using a ready2run compiled version of the code ? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Open the file using System.Reflection.Metadata and check that |
Beta Was this translation helpful? Give feedback.
-
Ok @davidwrighton , I take it that you comment says that even though the exe-file has non-empty PEReader.PEHeaders.CorHeader.ManagedNativeHeaderDirectory there are more things that determine if the native image is used or not and there is no deterministic api. |
Beta Was this translation helpful? Give feedback.
-
For loaded methods, there is information the assembly and method load events that you can examine to determine:
You can even do this in process. Here's a partial sample that could be fleshed out to capture all of the above. |
Beta Was this translation helpful? Give feedback.
Open the file using System.Reflection.Metadata and check that
PEReader.PEHeaders.CorHeader.ManagedNativeHeaderDirectory
is non-empty.