开发者

Accessing currently active CLRPolicy from a loaded dll

开发者 https://www.devze.com 2023-04-12 02:48 出处:网络
I\'m trying to access the application\'s CLR runtime host and change its policy via the 开发者_开发技巧poilcy manager.

I'm trying to access the application's CLR runtime host and change its policy via the 开发者_开发技巧poilcy manager.

The problem is that all the examples i've seen seem to create a new CLR runtime and start it the application with it.

I'm looking for a way to access the CLR runtime that's already running, and use SetActionOnFailure() to change its failure policies.

So, how can i do that in C# or c++/cli ?

Examples I've found (but don't seem to work on a running CLR runtime host):

Specifying Escalation Policy Using the CLR Hosting Interfaces

Surviving after StackOverflowException


I believe the policy has to be set before any code is JITted, because it will be baked in during native code generation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号