简体   繁体   English

来自不同程序集的方法调用

[英]Method call from a different assembly

Let's suppose that program A loads assembly A and assembly B. These 3 entities live under the same app domain. 假设程序A加载了程序集A和程序集B。这3个实体位于同一个应用程序域中。 Program A can access public methods and properties of assembly A and B. 程序A可以访问程序集A和B的公共方法和属性。

Is it possible that Assembly A can access somehow public methods and properties of Assembly B without reloading the assembly? 程序集A是否可以以某种方式访问​​程序集B的公共方法和属性,而无需重新加载该程序集? If not, and assembly B needs to call Assembly.Load , will the runtime understand that is already loaded and return a reference, or the assembly will be loaded from scratch in a separate memory space and be assigned a different reference? 如果不是,则程序集B需要调用Assembly.Load ,运行时是否会理解已经加载的程序并返回引用,还是将程序集从头加载到单独的内存空间中并分配一个不同的引用?

您可以使用AppDomain.GetAssemblies来查看某个程序集是否已经加载,但它也是在内部处理的,而Assembly.Load不会将同一程序集两次加载到同一域中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM