构建后缺少组装

Maz*_*aie 5 c#

我的C#解决方案中有5个项目.

  1. 共同
  2. 数据访问.
  3. UI
  4. 组件
  5. 测试

我可以添加对Components.dll的引用.但是,当我运行解决方案时,我得到了错误:

类型或命名空间名称"组件"不存在.

该Components.dll是在引用文件夹中已经存在.

你能帮帮我吗?

这是构建输出:

------ Rebuild All started: Project: Comps, Configuration: Release Any CPU ------
  Comps -> ..\Ashyaneh\Comps\bin\Release\AshyanehComps.dll
------ Rebuild All started: Project: Interfaces, Configuration: Debug Any CPU ------
  Interfaces -> ..\Ashyaneh\Interfaces\bin\Debug\AshyanehInterfaces.dll
------ Rebuild All started: Project: Common, Configuration: Debug Any CPU ------
  Common -> ..\Ashyaneh\Common\bin\Debug\AshyanehCommon.dll
------ Rebuild All started: Project: Web, Configuration: Debug Any CPU ------
  Web -> E:\My Programming 1391\HRShojaieWebAppRC2\Ashyaneh\Web\bin\Web.dll
------ Rebuild All started: Project: Test, Configuration: Debug x86 ------
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9):
warning MSB3253: The referenced assembly "AshyanehComps.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.
  Test -> ..\Ashyaneh\Test\bin\Debug\Test.exe
========== Rebuild All: 5 succeeded, 0 failed, 0 skipped ==========
Run Code Online (Sandbox Code Playgroud)

Joh*_*ner 16

这是你的问题:

引用的程序集"E:\ My Programming 1391\HRShojaieWebAppRC2\Ashyaneh\Comps\bin\Release\AshyanehComps.dll"无法解析,因为它依赖于"System.Web,Version = 4.0.0.0,Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a"不在当前目标框架中".NETFramework,Version = v4.0,Profile = Client"

假设您正在尝试运行.NET 4.0,那么您正在针对"轻量级"客户端配置文件基类库进行编译.您需要包含System.Web的完整Framework Framework Libraries.

解

要更改此项,请右键单击Project for AshyanehComps.dll>单击属性>单击"应用程序"选项卡>将"目标框架"更改为".NET Framework 4".

为了安全起见,我会按照上述步骤对您解决方案中的所有项目进行操作,您应该做得很好.