Enterpriselibrary Wrong version is getting packaged in TFS

Topics: Enterprise Library Core, Exception Handling Application Block
May 12, 2012 at 12:10 PM
Edited May 12, 2012 at 12:54 PM


I created an application and is being deployed through TFS build.  After deploying when we accessed the app, we are getting the below error.

Error Status Code: 'InternalServerError' Details: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1............ or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

When we looked at the deployed folder we are seeing EnterpriseLibrary.Common 5.0.  The project is refering to EnterpriseLibrary 4.1 dll (4.1 is what we require). We are referring to these dlls from a folder named GlobalReferences (We verified in TFS and the project is not referring the dlls from anywhere else - we are using enterpriselibrary logging and exception handling dlls).  But in the deployed server when we checked it is somehow 5.0 is getting copied.

Replaced the 5.0 dlls to 4.1 and it worked. Packaged through MSIs on local server for this project and it worked fine.  It is copying the correct version of the dlls. 

But on the TFS Server it is packaging with the wrong version of EL.  We are suspecting that in the build server, while packaging it picks up a different version from GAC or from somewhere else?

Could anybody please guide on why we are getting this issue.