检测到的循环:我可以明确允许循环依赖性吗?
我正在使用一个相对较大的C#.NET代码库,该代码库分为许多不同的子项目,最终将其构建为一个应用程序。我最近添加了一些功能,但最终创建了一个循环依赖性:
我的新模块需要访问某些现有功能,从而将其导入。同时,我导入的模块具有访问新模块的某些属性的零件。因此,我有一个循环依赖性,两个项目分别互相进口。
骑手,或更确切地说,编译器会以错误NU1108:检测到的循环投诉。
我认为,这个周期完全可以,我只是无法建立我的项目。我该如何处理这种依赖性?我需要完全重组代码吗?
I'm working with a relatively large C#.NET codebase that is split into many different sub-projects, ultimately building into one single app. I recently added some functionality, but ended up creating a circular dependency:
My new module needs access to some existing functionality, and thus imports it. At the same time, the module I imported has a part which accesses some properties of the new module. As such, I have a circular dependency where two projects import each other respectively.
Rider, or rather the compiler, complains about it with error NU1108: Cycle detected.
In my opinion, that cycle is totally fine, I just can't get my project built. How can I deal with this dependency? Do I need to completely restructure the code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论