AOT: Determine runtime version linked to native binary #105705
-
Hi, is there any obvious mechanism to determine for a AOT compiled binary which version of the runtime it was linked against? (It would be obvious from the build log.) Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
AustinWise
Aug 2, 2024
Replies: 1 comment 3 replies
-
Does Environment.Version or RuntimeInformation.FrameworkDescription have the information you are looking for? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want a way to identify the AOT version used to create any binary, by anyone? Or just for the binaries you create?
If you want to identify an executable as being generated by NativeAOT, all NativeAOT executables export a symbol named
DotNetRuntimeDebugHeader
. It points to this struct. Currently this struct does not contain the product version. You could open an issue or PR requesting the product version be added to that structure.If you have symbols for the executable, you can easily find the
RhGetRuntimeVersion
function. This is an implementation detail, but it currently has the product version. Here it is decompiled in Ghidra:You could also change your build process to include …