我有一个项目,它曾经在 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 库,由于其他人拒绝构建,这两个项目都没有构建。我已经尝试删除并重新创建可移植库,但是当从另一个项目中引用它们时它们仍然不会构建。
这是我在两个可移植类库的框架设置中所拥有的: