开发者

Accessing currently active CLRPolicy from a loaded dll

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜