简体   繁体   中英

TFS 2012 build: having both VS 2010 and VS 2012 installed

On a Build machine, I have both VS 2010 and VS 2012 installed. (We are nearly finished migrating from VS 2010 to 2012 and have just migrated to 2012, the build machine is also on TFS 2012.) I seem to need this for features like static code analysis.

When running the build I now encounter errors: the FXCop seems to be very good at selecting the wrong .exe version whereas different (rule) .dlls are in the project files. (Meaning: I have v10 files in the project file, but v11 exe is taken or vice versa.) On top of that (after uninstalling VS2010) I ran into problems with some legacy C++ projects that require VS 2010 (requiring some MSBuild v100 rather than v110).

In the end I uninstalled VS2012 and probably will revert once we have completely moved to VS 2012 (some members of the team are still happy if projects are compatible with VS 2010). Actually, things are working now with only VS2010 installed (though I had to revert some changes).

Is there a better way, is it eg possible to determine which FXCop you are using for static code analysis from within the build when having several VS versions installed?

Well, this is kind of a mess. I ended up selectively choosing what to put on our build server, rather than trying to sit VS2010 and 2012 side-by-side (had a lot of problems with 2012 there, so ended up having to rollback, too).

We ended up adding -

  • .NET 4.5 SDK
  • .NET 4.5 multi-targeting pack
  • .NET 4.5 Framework
  • Copy the files in C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\PublicAssemblies on a machine with VS2012 installed to the same path on the build machine
  • Copy the files in C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v11.0 on a machine with VS2012 installed to the same path on the build machine

I think that took care of everything, but it was a lot of trial-and-error to get all of the assemblies there. Good luck!

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