通过 ICLRRuntimeHost 和 ExecuteInDefaultAppDomain() 在远程进程 CLR 运行时运行代码
我尝试结合 编码轮子 和分析器附加。一切似乎都很顺利,除了当我尝试枚举远程进程的默认应用程序域中正在运行的程序集时,我没有得到正确的列表。
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.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...
return 3; } }
这是我使用的代码的链接: main.cpp
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论