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.

Was it helpful?

Solution

This is known issue. Link, Link, Link, Link

I fixed it by removing System.Core assembly reference from project, I think (it was long time ago).

Or try to modify your project this way:

<Reference Include="System.Core">
    <RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>  

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.Empty Reference Paths

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top