如何实现类库中定义的接口和实现单独的进程
我在单独的类库(程序集)中定义了不同的接口,并且它们需要由该过程中定义的类来实现。
问题是接口是在单独的类库(程序集)中定义的,并且必须在不同的 CLR 进程(程序集)中实现。添加类库作为参考可以完成这项工作吗?
为了告诉 CLR 进程(程序集)中定义的类,类必须实现在单独的类库(程序集)中定义的接口(作为参考包含在内),我还需要提及什么吗?
我的环境是C++/CLI。
I have different interfaces defined in a seperate class library (assembly) and they need to be implemented by classes defined in that process.
The problem is that the interface is defined in a separate class library (assembly) and must be implemented in a different CLR process(assembly). Will adding class library as a reference do the job?
Is there anything else I need to mention in order to tell my classes defined in CLR process (assembly) that classes must implement interfaces which are defined in a seperate Class library (assembly) which's included as reference?
My environment is C++/CLI.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够添加类库作为对项目的引用。仅此而已 - 只需照常实现接口即可。
请注意,程序集不是“CLR 进程” - 许多程序集被加载到同一个进程中,甚至加载到同一个 AppDomain 中。
You should just be able to add the class library as a reference to the project. There's nothing more to it than that - just implement the interface as normal.
Note that assemblies aren't "CLR processes" - many assemblies are loaded into the same process, and even into the same AppDomain.