We have a Visual Studio 2008 solution with 58 projects. One project targets the 3.5 runtime while the other 57 target 3.0. The solution builds fine in Visual Studio 2008. I open the solution in Visual Studio 2010 and proceed through the Upgrade project Wizard. When prompted, I decline targeting the 4.0 runtime and stick with the currently selected runtime. The conversion completes with no errors.
When attempting to build I get a large number of the following two warnings:
"The primary reference [AssemblyX] could not be resolved because it has an indirect dependency on the .NET Framework assembly "CrystalDecisions.Enterprise.Framework, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" which has a higher version "11.5.3300.0" than the version "10.5.3700.0" in the current target framework.
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets"
and
"The primary reference [AssemblyY] could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets"
I looked at the manifest for an assembly where this error occurs:
// Metadata version: v4.0.30319
.assembly extern System.Web
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
.ver 2:0:0:0
}
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0 //***********Why is this targeting the 4.0?
}
.assembly extern System.Xml
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 2:0:0:0
}
.assembly extern [SomeAssembly1]
{
.ver 1:0:0:0
}
.assembly extern [SomeAssembly2]
{
.publickeytoken = (A7 E6 CA C5 42 3F 9E A9 ) // ....B?..
.ver 3:1:30307:0
}
.assembly extern [SomeAssembly3]
{
.publickeytoken = (A7 E6 CA C5 42 3F 9E A9 ) // ....B?..
.ver 3:1:30307:0
}
.assembly extern mscorlib as mscorlib_6
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 2:0:0:0
}
.assembly extern System
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 2:0:0:0
}
.assembly extern Relo.Profile.Client
{
.ver 1:0:0:0
}
.assembly extern PRERS.Logging
{
.publickeytoken = (A7 E6 CA C5 42 3F 9E A9 ) // ....B?..
.ver 3:1:30307:0
}
.assembly extern Microsoft.Practices.EnterpriseLibrary.Logging
{
.publickeytoken = (74 B5 57 D6 49 41 67 26 ) // t.W.IAg&
.ver 3:1:0:0
}
I looked at the refernces that SomeAssembly1, SomeAssembly2, SomeAssembly3 (and the entire solution) make and I can't find anything that is targetting 4.0.
I've searched for solutions/discussions on the internet and none of the workarounds I have found seem to work for me.
http://social.msdn.microsoft.com/Forums/en/msbuild/thread/516647ee-dccf-49ee-959a-00b1fc098eeb
http://connect.microsoft.com/VisualStudio/feedback/details/571860/assemblies-targetting-net-3-5-will-not-load-in-applications-also-targetting-net-3-5
http://arstechnica.com/civis/viewtopic.php?f=20&t=1112439
http://connect.microsoft.com/VisualStudio/feedback/details/510467/migrated-project-cant-compile-the-commandline-for-resgen-task-is-to-long
Any help is greatly appreciated. Thanks!
See these two blog posts to fix your problem:
http://traf-o-data.blogspot.com/2010/10/mystery-of-mscorlib.html
http://customerfx.com/pages/integrationblog/2010/11/08/working-with-crystal-reports-v11-5-and-visual-studio-2010-error-adding-references-to-crystaldecisions-dlls.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With