简体   繁体   中英

TFS Build assembly version conflicts

I have a build definition with projects that use different versions of .NET. Some use 4.0 and others use 4.5 .

  • Projects for 4.0 use EntityFramework 4.4.
  • Projects for 4.5 use EntityFramework 5.0.

This is giving me a lot of headaches because, while the compilation goes OK, tests won't pass in the build server because the EntityFramework assembly is the incorrect one.

It seems that each project overwrites existing assemblies with the ones it requires in the output folder, so it's a matter of luck that the correct one is loaded to run the tests.

How would I avoid this problem? Can I force the output folder to keep the latest version of EF and put assemblybindings?

Thanks.

EDIT: I've checked the Build Definition based on answers and found this:

EDIT 2 : The snapshot corresponds to a template that was migrated from previous versions of TFS, so it doesn't look like the default one. Anyways, the option that I highlighted works for me :) I've marked the question as answered.

构建定义

You basically have 3 choices, depending on how what you are building will look when it is deployed.

Option 1 Set the output Location to be PerProject or AsConfigured , this will allow each application to be dropped to it's own folder and then the tests should run independently with the target EF framework. This is good if you will be deploying seperate applications on a per project basis. 构建定义集输出位置

Option 2 Leave everything as is and change your build order so that the latest version of EF gets built last, therefore leaving the latest version in the drop folder, you can then add redirects as required

Option 3 Standardise on a version of EF and update all of the projects to point to the single version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM