Msbuild 4.0 is referencing System.Core 4.0 when the project targets 3.5?
Question
Msbuild works fine on my computer, but when I try to build the project with bamboo/msbuild it for some reason is referencing .net 4.0.
DB\DbExt.cs(95,42): error CS0433: The type 'System.Func<T1,T2,TResult>' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll' and 'c:\Windows\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll' [C:\Users\Administrator\bamboo-home\xml-data\build-dir\GITEXP-GITEXPORT-JOB1\NotMissing\NotMissing\NotMissing.csproj]
I need to use MSBuild 4.0 because I am using new compiler features (default parameters, etc). For some reason System.Core 4.0 is being referenced even though it targets 3.5.
OTHER TIPS
Make sure there is nothing mentioned in the Reference Paths tab of the project properties. If you want to mention the reference path of the dll here, you should make sure that the dll you are adding is present only once in the mentioned path.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow