TFS Build: Referenced assembly ‘…dll’ targets a different processor than the application

 

For both the application and the referenced library check that the following match

Project > Properties > Compile > Advanced Compile Options > Target CPU ( possibly also the Target Framework )

If difficult to find use the Build explorer > View Log > Next Warning to work out the application project

Advertisements

TFS Build: Could not resolve this reference. Could not locate the assembly ”. Check to make sure the assembly exists on disk.

A TFS Build fails probably after a new reference has been added. Possibly a .exe reference

ERROR
TFS Build: Could not resolve this reference. Could not locate the assembly ‘<name>’. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors

SOLUTION
In Team Explorer > Builds > Build Explorer > Select broken build and double-click to work out which project did not build
Visual Studio > Projects > Project Dependencies > Select project that is not building > Add the required dependency > Confirm that the Build Order tab now shows this project higher than the project failing to build

Still did not work. Removed and added the reference again and it then worked.
The change in Source Control for the file was that the version no was in the broken version. not in the fixed version. Before here:

After here:

 

VS TFS Build

Microsoft.Common.targets (1360): Found conflicts between different versions of the same dependent assembly

Problem

Warning : “Found conflicts between different versions of the same dependent assembly”

Not enough information

Solution – Method

The verbosity of builds may be changed in Visual Studio > Tools > Options > Projects and Solutions > Build and Run > MSBuild Project output verbosity. May need to go to at least detailed. Then use the output window to get more information.
The verbosity may also be changed in the VS-TFS build.

Then search in the Output for “conflict”, and underneath it states:

“References which depend on “… new version
“References which depend on “… old version

Make them match.

Solution – Binding Redirect

Optionally check-in the file containing the app.config.

If you double click on the warning then you may get a message:

“One or more dependent assemblies have version conflicts.
Do you want to fix these conflicts by adding binding redirect records in the app.config file?”

If you click OK, then use source code control to compare the app.config you will get a change in the newVersion setting

<runtime>
<assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″>
<dependentAssembly>
<assemblyIdentity name=”EntityFramework” publicKeyToken=”B77A5C561934E089″ culture=”neutral” />
<bindingRedirect oldVersion=”0.0.0.0-4.4.0.0″ newVersion=”6.0.0.0″ />
</dependentAssembly>
</assemblyBinding>
</runtime>

This Post History

VS-TFS Build was reporting this error for a long time, but not indicating precisely which file was causing the problem

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1360): Found conflicts between different versions of the same dependent assembly

Generally have found the problem to be on a project which references another project, where both projects use the same references. One may get out of sync with the project being built.

Found the problem difficult to find. Not entirely sure what the problem was:
The build server had a copy of version 9 of Microsoft.VisualBasic.PowerPacks.Vs in c:\Program Files\Common Files\Microsoft Shared\…
instead of version 10.0 listed in some projects.
I checked that version 10 was installed on the build server, then removed the version 9 from this pc.
Could have perhaps considered making the PowerPack reference copy local.

Also try working out any references listed in the problem project which are also used by referenced projects and include a reference to the problem project. I have found that where Visual Studio builds projects without the referenced project references, MSBuild seems to need them in the target project as well. This was not in fact the case in my resolution here.

Example solved 15-Mar-2011 was System.Windows.Forms.DataVisualization was version 3.5.0.0 in a user control. Upgraded all to 4.0.0.0.

See http://stackoverflow.com/questions/1871073/resolving-msb3247-found-conflicts-between-different-versions-of-the-same-depend

Build server automated tests fail SQL authentication

If unit tests are testing against the database using Integrated Security then when these automated tests are put onto the build machine authentication may fail.
SOLUTION. Create a SQL login for a machine which is possible.
CREATE LOGIN [MyDomain\MyComputer$] FROM WINDOWS;
http://social.msdn.microsoft.com/Forums/en/sqlsecurity/thread/315b5780-c131-4867-88b9-ebac82e68d77