c# – VS2010项目之间的汇编引用失败

语境:

我的解决方案有3个项目(C#,.NET 4.0):

> Abc.Business(Dll项目)
> Abc.Test(测试项目)
> Abc.Ui(Wpf项目)
Abc.Business是我的业务逻辑.它包含实体,经理,服务等.
Abc.Test有Abc.Business的项目参考,是单元测试.他们工作得很好
> Abc.Ui有Abc.Business的项目参考

Abc.Ui无法解决所有使用Abc.Business;
错误日志显示:

Error The type or namespace name ‘Business’ does not exist in the namespace ‘Abc’ (are you missing an assembly reference?) c:\Abc\Abc.Ui\ViewModels\ClientViewModel.cs

另外,当我在文件的顶部手动输入使用时,Intelli-sense会显示“Abc.Business.etc ..”.所以Intelli感觉走在参考,但是并没有建立.

有任何想法吗 ?

解决方法

非常感谢 GrhmHenk Holterman谁指出了架构解决方案.其实这不是问题,而是让我找到它.问题是框​​架目标.默认情况下,Ui项目的目标是使用“客户端”配置文件的.NET 4.0 Framework.此配置文件不能引用非客户端配置文件.我发现在不够用的调试输出窗口中. (我习惯于查看错误列表)

以下是错误显示:

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3253: The referenced assembly “C:\Abc\Abc.Business\bin\Debug\Abc.Business.dll” could not be resolved because it has a dependency on “System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a” which is not in the currently targeted framework “.NETFramework,Version=v4.0,Profile=Client“. Please remove references to assemblies not in the targeted framework or consider retargeting your project.

我将配置文件更改为正常(无)和BOOM所有工作

再次感谢你们的时间.

相关文章

1:最直白的循环遍历方法,可以分为遍历key--value键值对以及...
private void ClearTextBox(){ foreach (var control in pnl...
原文叫看《墨攻》理解IOC概念 2006年多部贺岁大片以让人应接...
右击文件夹->安全选项卡->添加->高级-...