如何实现类库中定义的接口和实现单独的进程

发布于 2024-09-07 14:27:28 字数 217 浏览 1 评论 0原文

我在单独的类库(程序集)中定义了不同的接口,并且它们需要由该过程中定义的类来实现。

问题是接口是在单独的类库(程序集)中定义的,并且必须在不同的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界和平 2024-09-14 14:27:28

您应该能够添加类库作为对项目的引用。仅此而已 - 只需照常实现接口即可。

请注意,程序集不是“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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文