且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

VB.NET-项目-循环依赖

更新时间:2023-02-16 12:34:32

在VB.Net中,我从WAM_TaskSelector调用WAM_Utils中的Form2.并能100%工作.现在,我想在原始项目(WAM_TaskSelector)中打开一个Form1,并且想添加引用的那一刻,它告诉我存在循环依赖", 有办法解决吗?

In VB.Net, I call a Form2 in WAM_Utils from WAM_TaskSelector. and that works 100%. Now I want to open a Form1 in the original project (WAM_TaskSelector) and the moment that I want to add a reference, it tell me there is a "Circular Dependency", is there a way around this?

如果要打开Form1,为什么要添加引用?如果是因为表单在另一个项目中,则解决方案是将表单移到第三个项目中,并将该第三个项目作为两个现有项目的参考.

If you want to open a Form1, why are you adding a reference?  If it's because the form is in another project, then the solution is to move the form into a third project, and include that third project as a reference from both the existing projects.