开发者

running code in remote process CLR runtime through ICLRRuntimeHost and ExecuteInDefaultAppDomain()

开发者 https://www.devze.com 2023-01-16 05:22 出处:网络
I tried to combine the examples at coding the wheel and profiler attach.Everything seems to go fine, except, when I try to enumerate running assemblies in the remote processes\' default appdomain, I d

I tried to combine the examples at coding the wheel and profiler attach. Everything seems to go fine, except, when I try to enumerate running assemblies in the remote processes' default appdomain, I don't get the right list.

    public class remoteFoo {
    public static int sTest(String message) {
    AppDomain currentDomain = AppDomain.CurrentDomain;
    Assembly[] assems = currentDomain.GetAssemblies();
    MessageBox.Show("List of assemblies loaded in current appdomain:");
              foreach (Assembly assem in assems)
                  MessageBox.Show(assem.ToString()); //remoteFoo gets listed, but not hostBar.

return 3; } }

remoteFoo gets listed, but not hostBar. Basically I want to use introspection to run code in the remote process's appdomain. But it seems that I don't have the right appdomain开发者_开发技巧...

Here is a link to the code I use: main.cpp

0

精彩评论

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