Steed
Steed

Reputation: 287

build error, warning MSB3258

I have recently moved my solution from my main dev machine using vs2010 pro sp1 to a new machine. The setup is supposed to be the same except its failing to build.

Its giving errors like

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3258: The primary reference "C:\rep\hms\trunk\ikassystemv3\ikasDAL\bin\Debug\ikasDAL.dll" 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.

However all all the libraries in question are set to use the .net 2 framework and I need it this way or else it will break stuff that uses them.

However for some reason it seems to think that somehow my .net 2 system libs are somehow referencing .net 4 stuff. All the referenced libs are .net 2

You can see my build output here

http://tinyurl.com/bnugru4

Upvotes: 6

Views: 5984

Answers (2)

ChrisLively
ChrisLively

Reputation: 88092

From the logs it sure looks like someone wrote the ikasDAL.dll in 4.0 because it has dependencies on things like System.Xml.Linq etc which wasn't present in the 2.0 framework.

From all appearances I'd say someone artificially set the ikasDAL.dll down to be 2.0 without realizing what it depends on. If this is the case, then I think you have a bigger problem.

Alternatively, ikasDAL was set to 4.0 recently and you've reset it back to 2.0 but didn't fix it's dependencies.


I'd start by doing a manual clean of all of the bin directories (basically delete them). Then I'd look at each individual project to ensure that it is indeed set to 2.0. Finally, I'd build each project one at a time until I hit a problem.

Upvotes: 0

Christoffer
Christoffer

Reputation: 12918

I've seen this problem when using a CopyLocal project reference and changing the target framework (i.e. .NET 4 to 2) on the dependent project (i.e. ikasDAL.dll).

If that is the case here, deleting the output folder (i.e. C:\rep\hms\trunk\ikassystemv3\ikasDAL\bin\Debug) and rebuilding should fix the whole thing.

Upvotes: 2

Related Questions