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 e. g. 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!
Related
Is there any way that I can use the latest IDE (VS2015) to work with my old solution project but i don't wish to upgrade my project?
Unfortunately, you cannot do this. The format of project and solution files was changed in VS 2010, so the furthest back you could possibly go with VS 2015 would be to VS 2010.* And that wouldn't help you any for cross-compatibility, since VS 2008 can't open VS 2010 project files.
You have no real choice but to allow the IDE to convert your solution and project files to the latest version. However, this will not delete your old VS 2008 project/solution files. They will still be in the solution directory, and will still work for opening the solution in VS 2008. The new project/solution files will open the solution in VS 2015.
This was a very common strategy employed by open-source projects before recent versions of Visual Studio implemented cross-compatibility. They would just have multiple versions of project and solution files for each supported version of Visual Studio.
The only disadvantage with this is that changes you make to one version of a project or solution file don't propagate to the others automatically. But this isn't really that big of a deal, since once a project is reasonably mature, the project and solution files don't change very often.
* In fact, VS 2015 interoperates smoothly with project/solution files from VS 2013, VS 2012, and VS 2010 SP1. It can create and modify project files for any of these versions. See MSDN: Porting, Migrating, and Upgrading Visual Studio Projects (for Visual Studio 2015)
Now that Visual Studio 2015 RC is out, has anyone installed it and opened Visual Studio 2013 projects/solutions?
Does it ask the files to be changed?
If yes, are the changes it makes backward compatible?
Take a look at the Porting, Migrating, and Upgrading Visual Studio Projects article for Visual Studio 2015. All of the various caveats are described there.
Not all types of project are supported. I tried the following 4 project types:
Vb.net Class project, OK.
Vb.net Web Services project, OK.
Cordova JS project, not OK, need to migrate manually, by moving the sources from root directory to the www directory and install all API again.
C#.net winform project, OK.
Yes, though you sometimes will have to change the version (single number) in .sln file, no other differences found yet.
We resolved this by typically excluding this file from check in and only check it in when there really was a change (added project, ...) - and then to fix the version before checking in. (Different developer machines with different versions of VS.)
See question Visual Studio 2015 solutions backwards compatibility with Visual Studio 2013 and answer https://stackoverflow.com/a/31540590/586754.
(Assuming you are having basic projects that are supported by both versions, like C# and .net framework that is supported by lower version VS.)
Can we use MSBuild without Visual Studio 2012?
Currently, we have a build server where we are compiling and creating deployment copy of one of our projects, it has Visual Studio Professional Edition installed. We are setting up a new build server now. Do we really need Visual Studio 2012 on the new build server?
If yes, then how? I googled it but I couldn't find an answer.
We have spent a lot of time trying to get our Build Servers to work without Visual Studio.
We do not use TFS for builds and therefore I am not sure the license exemption above applies to us. Also not having Visual Studio installed helps you really understand how your software is building and get references correct.
We have seen many examples of solutions with projects that contains references for the same piece of software with some in nuget packages shipped with the solution and others that are pointing to locations in the "program files" path which are not present on machines without Visual Studio installed. Once you attempt to build software without VS installed you can really see how "self-contained" your applications are.
Before I start listing the things you typically need to install, let me just point out that MS Build is now no longer considered part of the .NET framework but is shipped with Visual Studio but can also be installed separately. See this blog post for more: http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx
The following software needs to be installed for most builds, there may be others for example if you are creating portable class libraries.
Microsoft Build Tools 2013
Web Deploy 3.5 (for packaging applications)
Microsoft .NET Framework 4.5.1 Developer Pack
Microsoft .NET Framework 4.5.2 Developer Pack
Windows Software Development Kit (SDK) for Windows 8 (You can use the SDK to build applications that target these operating systems: Windows 8, Windows 7, Windows Vista, Windows Server 2012, Windows Server 2008 R2, Windows Server 2008)
The following directories need to be copied:
Reference Assemblies (need to be copied from a machine running Visual Studio from/to directory C:\Program Files (x86)\Reference Assemblies)
Public Assemblies (need to be copied from a machine running Visual Studio from/to directory C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies
We also use Wix and therefore we install the following:
WIX Toolset 3.8
I have a similar set for testing however that was not part of the question so I will leave that off!
Hope this helps someone.
Update: 3rd March 2017
Microsoft recently responded to a long standing user voice request "Support .NET Builds without requiring Visual Studio on the server" for the requirement for Visual Studio to be installed on a build server to be removed.
From the description on the download page "These Build Tools allow you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE." Not tested yet but after RTM I will look at this and provide a further update here.
There is a blog post that promises these build tools install all pre-requisites and can be used to build MS Build based applications.
No, you don't need Visual Studio on your build box. If I recall correctly, msbuild is installed as part of the .NET framework - it certainly used to be.
Depending on what you're building, you may find that there are some things which are easier to get working if you do install Visual Studio though - things like portable class library profiles. While there are usually non-VS installers available, I've found it simpler to install an Express edition of Visual Studio just to get the bundled build targets.
Remember: The easiest way to build your visual studio solutions is to install Visual Studio on the build server. Even Visual Studio Express is often enough.
That said, you can make it work without it. But it it sometimes a lot of work to figure out. You'll need to install the right Windows / .NET Platform SDK. You can install multiple of these SDKs side by side. Now, when you depend, for example, on ASP.NET MVC 5 or Entity Framework 6, you might need to install further SDKs to get your application to compile. The downloads for these all assume that you also have Visual Studio installed, but many of their payloads can also be installed separately. It can become quite a hassle.
Personally I've grown tired of trying to figure out which parts of which installers enable what. But that is also driven by the fact that Microsoft allows you to install Visual Studio on a build server (TFS) with the same license as your development machine as long as you are an MSDN subscriber. Check the Visual Studio License Whitepaper for more details.
Using Visual Studio on the Build Server
If you have one or more licensed users of Visual Studio Ultimate with MSDN, Visual Studio Premium with MSDN, or Visual
Studio Professional with MSDN, then you may also install the Visual Studio software as part of Team Foundation Server
2013 Build Services. This way, you do not need to purchase a Visual Studio license to cover the running of Visual Studio on
the build server for each person whose actions initiate a build.
If you, like me, would prefer this to change in the future, I suggest you make sure you're heard by submitting your request or voting for an existing one over at the Visual Studio User Voice.
Here's just a quick take on this.
Your build machine should decouple development tools as much as is possible. With that said, and as already stated by others here, MSBuild can be run independently of Visual Studio, and it should!
If your build requires Visual Studio to run then there is a very good chance that you have a solution or project architecture problem that ought to be resolved.
Visual Studio doesn't need to be installed. MSBuild is part of the .net SDK.
Other .net dependencies will need to be installed though, if you are using them. MSTest, or anything that is part of Team foundation will require Visual Studio installed.
I believe you only need MSBuild ( that is part of the .NET framework you're targeting ) .
Make sure you install the proper .NET distribution
the following is a good place for build servers it have the developer tooling.
The .NET Framework 4.5.1 Developer Pack installs the multi-targeting pack for .NET Framework 4.5.1. Developers can build applications targeting the .NET Framework 4.5.1 using either Visual Studio 2012 or third party IDEs. You need to download the web installer instead of this package if you intend to redistribute .NET Framework 4.5.1.
http://www.microsoft.com/en-us/download/details.aspx?id=40772
Best of luck.
C++ :
There is a "Build Tools" that contains MSBuild, Visual studio is not required.
From the official doc :
These tools allow you to build C++ libraries and applications
targeting Windows desktop. They are the same tools that you find in
Visual Studio 2015 in a scriptable standalone installer. Now you only
need to download the tools you need to build C++ projects.
Managed :
The same applied : Build Tool Managed
Background
I am open sourcing a few old Visual Studio applications I created a while back. I have created new solutions using my new VS2012 environment for them and have gotten the projects set up as git repositories. I got everything working fine in Visual Studio 2012 with no changes to the source code, all I needed to do was make sure I was linking the proper libraries in the new project configurations.
I would like to configure these projects as to have maximum compatibility for others downloading the project from Github. On this machine I have VS2010 installed alongside the latest VS2012 version. After I got everything working right for both of the projects in VS2012, I tried to open them up in VS2010.
When I tried to build I got a single error:
Specified platform toolset (v110) is not installed or invalid.
Please make sure that a supported PlatformToolset value is selected.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets 518
What I Tried
So I opened up the properties for the project, went to Configuration Options --> General and the Platform Toolset was indeed set to Visual Studio 2012 (v110). This input is a drop down box and the v110 value is not listed, instead I get two choices:
v100
v90
These correspond to VS2010 and VS2008 respectively. If I change the value to v100 and rebuild I get no errors and my program runs just fine in my Visual Studio 2010 environment.
When I open the project back up in Visual Studio 2012, if tells me that I have an old project file and asks if I want to upgrade, I say yes and it upgrades. I rebuild and run to make sure everything is still working. When I open the configuration options in VS2012 the Platform Toolset is set back to `Visual Studio 2012 (v110) but clicking the drop down input there are several more choices listed:
Visual Studio 2012 (v110)
v110_wp80
Visual Studio 2012 - Windows XP (v110_xp)
Visual Studio 2010 (v100)
Visual Studio 2008 (v90)
‹inherit from parent or project defaults›
My Questions
This has led me to several questions. I am going to pose them all. It would be nice to get as much information as I can, but a good answer to just one of them would probably solve my problem.
If I'm not using features specific to newer versions of Visual Studio, is it possible to set up a solution which can be opened and run without modification in as many versions as possible (ie. 2008, 2010, or 2012)? If so, how?
If I set the Platform Toolset to v90 (VS2008) from within Visual Studio 2012, and it's able to build and run, does this mean that it will build and run for users with VS2012, VS2010, and VS2008?
What exactly does the <inherit for parent or project defaults> option do? What would the project defaults be set up as? Can this be used to tell Visual Studio to try to using whichever installed Platform Toolset will work.
Are there any other options besides Platform Toolset in Visual Studio that I can set to increase compatibility with others' development environments?
This is a somewhat tricky situation. One of the underlying problems here is that VS2010 and VS2012 use MSBuild to build C++ projects, but VS2008 farmed it out to VCBuild instead. You can see this by comparing the project files. VS2010/VS2012 use .vcxproj, while VS2008 uses .vcproj.
If I'm not using features specific to newer versions of Visual Studio,
is it possible to set up a solution which can be opened and run
without modification in as many versions as possible (ie. 2008, 2010,
or 2012)? If so, how?
For maximum compatibility, you want to target the lowest common denominator (i.e. vc90 in this case). Note that when you do the upgrade, the solution file and project files get upgraded to the latest version, which may break compatibility with older versions of Visual Studio.
If I set the Platform Toolset to v90 (VS2008) from within Visual
Studio 2012, and it's able to build and run, does this mean that it
will build and run for users with VS2012, VS2010, and VS2008?
Not really, due to the .vcxproj / .vcproj conflict stated above.
For example, I currently have a set of .vcxproj files and a solution designed for VS2010. I use VS2012 as my IDE, so when I open the VS2010 solution in VS2012, I choose to NOT upgrade it and simply open it as is. VS2012 and beyond should be backwards compatible back to VS2010 as far as project files go.
For maximum compatibility in development environments, my recommendation would be use VS2010's solution as the baseline, targeting v100. Developers can use any version newer than that and it should all work together gracefully.
I have around 50 projects in Visual Studio 2005 that I am building a new development machine for and I'd like to slowly move those projects to VS 2008 but also have 2010 available for select new projects.
Can this work? Are there any gotchas for this sort of setup? Any general advice for running multiple versions of Visual Studio on the same system would be greatly appreciated. Specifically related to managing a controlled migration of projects to new versions but being able to selectively keep some on old versions.
I've got 7.1, 8, and 9 installed at the same time (well, and VB part of 6 as well) and I've not really had a problem opening projects file in the wrong version. The Visual Studio Solution files is "associated" with a particular version even if they all have the same extension of .sln, as you can see from its little icon. Microsoft Visual Studio Version Selector seems to handle individual project files (.vcproj) fine as well.
The only thing I've had is the individual source code files not opening up in the latest version like I want, but that's easily fixed with the click of a little button in VS Opions.
Microsoft have this to say:
Visual Studio supports the installation of Visual Studio .NET 2002, 2003, ... on the same computer.
In general, you should install the earliest release of Visual Studio first, and then install subsequent versions of Visual Studio in the order in which they were released.
Make sure when you open up the 2005 files you're doing it in 2005. To open them in another would require a conversion which would render them incompatible with the older compiler set-up. To aid this, structure whatever workspace you're using into 2005, 2008, and 2010 so as to minimize accidental chance of this.
Second, when you double click to open the projects, it will invariably attempt to open them with 2010. You'll have to start with VS#### instead of the solution/project unless you're in the 2010 workspace.
I have VC6, VB6, VS 2008, and VS2010 RC installed on Windows Vista. I cannot double click on the VC6 dsp files without VS2010 opening and asking to perform the conversion. The 2008 C# projects open in 2008 as long as I use the solution file. The 2008 project file opens in 2010 instead of 2008 even though the version selector is the default program. Most of the time I try to remember to open the desired version of Visual Studio and then open the project.
You can mitigate some of these issues by changing the default program associations in the control panel or the registry.
Update: This setup works on Windows 7 x64, with the addition of VS2013.
Yes it can work. I'm not sure if you have to install them in a particular order... but install them in order of the versions... 2005, 2008, 2010. Should be good to go.
I can't speak for 2010, but I have run 2005 and 2008 at the same time on my system without any fuss.
And I made the double-click mistake that wheaties warns about more than once :(
I have VS2005 & VS2008 running without any issues. I have had problems when working with betas, express editions & am assuming you don't have them.
I would say refrain from making too many changes to the setup of these editions, it should be fine.
I also had the same doubt. I work at my company which is still on VS 2008 and I want to personally use the VS 2010 and not risk the 2008. I installed the 2010 and it worked fine with the 2008. Just make sure you note the projects that are in 2005 and open them with the same accordingly.
The reason why it works is simple: if you open your solution file in Notepad, you'll see which version of VS is related to your project.