且构网

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

由于循环依赖项错误,无法添加对项目的引用

更新时间:2022-05-08 21:40:08

这是您需要做的:

  1. 在解决方案资源管理器中右键单击DAL项目,然后在上下文菜单中选择项目依赖项.

您现在将看到一个窗口,其中显示了DAL项目的项目依赖项.确保未选中BAL.

You will now see a window that shows the project dependencies of the DAL Project. Make sure that BAL isn't checked.

现在,您应该可以添加参考了...

我希望这有助于我尽量保持简单明了.

I hope this helps I've tried to keep it as simple and straight forward as possible.

说明:

您的DAL应该不能访问BAL.您的代码引用依赖项应如下所示:

Your DAL should not be able to access the BAL. Your code reference dependencies should be like this:

MVC项目-> BAL-> DAL

MVC项目应引用BAL,BAL应引用DAL.这样设置您的项目.使其工作,然后您将更好地理解为什么此设置更好.

The MVC project should reference the BAL, the BAL should reference the DAL. Set up your project like this. Make it work and then you will better understand why this setup is better.

给出:

  1. 数据 = 原始数字和字符串
  2. 信息 = 将数据处理成有意义的内容
  1. Data = raw numbers and strings
  2. Information = processed data into something meaningful

考虑以下事项: 用户界面应从BAL获取其信息,该信息可以基于DAL构成其数据.

Cosider the following: The UI should get its information from the BAL which could be able to compose it's data based on the DAL.