解决循环依赖

问题描述:





我有两个类库lib1和lib2。我想在lib2中的lib1中使用一个类。而且我想在lib1中的lib2中使用一个类。我在lib2中添加了lib1引用。但是当在lib1中添加lib2引用时,显示无法添加它会导致循环依赖的错误。我如何解决

Hi,

I have two class libraries lib1 and lib2. i want to use one class inside lib1 in lib2. and also i want to use one class inside lib2 in lib1. i added lib1 reference in lib2. but when adding lib2 reference in lib1, an error showing that" cannot add it couses circular dependency". how can i resolve that

看看(从谷歌搜索结果的第一页):



http://www.roelvanlisdonk.nl/?p=1644 [ ^ ]

http://*.com/questions/7093908/cannot-add-reference-to-project-因为循环依赖性错误 [ ^ ]

http://*.com/questions/19045247/adding-this-project-as-a-reference-would-cause -a圆形依赖性-mvvm [ ^ ]

http://social.msdn.microsoft.com/Forums/vstudio/en-US/43645215-9d09-4435-961e-2255a4c19d85/参考项目之间?forum = csharpgeneral [ ^ ]
Have a look (from the first page of results in google):

http://www.roelvanlisdonk.nl/?p=1644[^]
http://*.com/questions/7093908/cannot-add-reference-to-project-because-of-a-circular-dependency-error[^]
http://*.com/questions/19045247/adding-this-project-as-a-reference-would-cause-a-circular-dependency-mvvm[^]
http://social.msdn.microsoft.com/Forums/vstudio/en-US/43645215-9d09-4435-961e-2255a4c19d85/reference-between-projects?forum=csharpgeneral[^]


仔细阅读文章

什么是循环依赖,我们如何解决? [ ^ ]