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
精彩评论