Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose CLR version in ClrRuntime #8

Closed
tomasr opened this issue Sep 24, 2015 · 1 comment
Closed

Expose CLR version in ClrRuntime #8

tomasr opened this issue Sep 24, 2015 · 1 comment

Comments

@tomasr
Copy link

tomasr commented Sep 24, 2015

When creating a ClrRuntime object, the user will often want to keep track of the version of the CLR that the runtime was created for. Because ClrRuntime doesn't expose the CLR version number, it often requires users to keep track of additional data.

It would be useful if ClrRuntime exposed a Version property (of type VersionInfo) that exposed this information directly. Exposing the complete ClrInfo object could be another option, but possibly too heavy-weight.

I looked at this and it does require a few changes in how ClrRuntime objects are created, as these do not contain the necessary information. Either we'd need to obtain it there, or another option would possibly change the ClrRuntime creation process so that you had to pass in the ClrInfo object as well, and not just the DAC location (though this would impact existing code).

This would also make it possible to easily hang interesting extension methods, such as checks for 4.5 or above, and so on (which are often very useful when analyzing code).

@leculver
Copy link
Contributor

I've went the route of exposing the full ClrInfo object. See this commit: 42ec848

However to use it you need to use the new startup path, which uses ClrInfo.CreateRuntime instead of DataTarget.CreateRuntime in the current branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants