0

我有一个项目,它曾经在 VS2010 中构建,现在不会在 VS2012 中构建。它的结构如下:

-Lime49 (Portable Class Library)
-Myproject.Shared (Portable Class Library)
--Myproject.Core (.NET4, references the above two libraries)

第一个可以自己构建,但是当我尝试构建第三个时,我得到The type or namespace 'Lime49' could not be found了控制台显示:

>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3268: The primary reference "Lime49" could not be resolved because it has an indirect dependency on the framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile2". To resolve this problem, either remove the reference "Lime49" or retarget your application to a framework version which contains "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
1>C:\<snipped>\MyProject\trunk\MyProject.Shared\Fraction.cs(11,7,11,13): error CS0246: The type or namespace name 'Lime49' could not be found (are you missing a using directive or an assembly reference?)
1>C:\<snipped>\MyProject\trunk\MyProject.Shared\Nutrition\USDA\USDAUtils.cs(5,7,5,13): error CS0246: The type or namespace name 'Lime49' could not be found (are you missing a using directive or an assembly reference?)
1>C:\<snipped>\MyProject\trunk\MyProject.Shared\UrlHelper.cs(6,7,6,13): error CS0246: The type or namespace name 'Lime49' could not be found (are you missing a using directive or an assembly reference?)
========

我的解决方案中还有两个项目同时引用了可移植库和 .NET 4 库,由于其他人拒绝构建,这两个项目都没有构建。我已经尝试删除并重新创建可移植库,但是当从另一个项目中引用它们时它们仍然不会构建。

这是我在两个可移植类库的框架设置中所拥有的: 框架配置

4

1 回答 1

0

您说第三个项目未能构建,但看起来它实际上是第二个项目。从警告消息中可以看出,您正在针对 Lime49.dll 版本进行构建,该版本实际上是 .NET 4.x 二进制文件且不可移植。

您能否确保 Lime49实际上是一个可移植项目,或者您不是针对曾经是 .NET 4.x 的旧版本的二进制文件构建的?

于 2012-10-30T20:37:06.103 回答