title: How to upgrade a solution and project files from the command line
body: <p>I am testing Free and Open Source Software using Microsoft's <a href="https://www.visualstudio.com/vs-2015-product-editions" rel="nofollow noreferrer">Visual Studio 2015 Community Edition</a> (and <a href="https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx" rel="nofollow noreferrer">here</a>) to ensure compatibility with the compiler and tools. The 30 day trial has expired, so I need to work from the command line because the IDE exists after telling me the trial has expired:</p>
  
  <p><a href="https://i.stack.imgur.com/aIBcF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aIBcF.png" alt="enter image description here"></a></p>
  
  <p>When I try to run <code>msbuild</code> from the command line, I get a couple of top level errors:</p>
  
  <pre class="lang-none prettyprint-override"><code>Test&gt; msbuild cryptest.sln
  Microsoft (R) Build Engine version 14.0.23107.0
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  Building the projects in this solution one at a time. To enable parallel build,
  please add the "/m" switch.
  Build started 9/7/2015 7:58:54 AM.
  Project "...\cryptest.sln" on node 1
   (default targets).
  ValidateSolutionConfiguration:
    Building solution configuration "Debug|Win32".
  MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
   To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua
  l Studio 2005 or 3) add the location of the component to the system path if it
  is installed elsewhere.  [...\cryptest.sln]
  Done Building Project "...\cryptest.sln" (default targets) -- FAILED.
  
  Build FAILED.
  
  "...\cryptest.sln" (default target)
  (1) -&gt;
  (cryptlib target) -&gt;
    MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe
  ". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Vis
  ual Studio 2005 or 3) add the location of the component to the system path if i
  t is installed elsewhere.  [...\cryptest.sln]
  
      0 Warning(s)
      1 Error(s)
  </code></pre>
  
  <p>The problems above are due to a down level (Visual Studio 2008) solution and project files.</p>
  
  <p>The official docs are at <a href="http://msdn.microsoft.com/en-us/library/hh690665(v=vs.140).aspx" rel="nofollow noreferrer">How to: Upgrade Visual C++ Projects to Visual Studio 2015</a>, but the page does not discuss a solution upgrade from the command line.</p>
  
  <p>According to the VC++ Team Blog at <a href="http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx" rel="nofollow noreferrer">Visual Studio 2010 C++ Project Upgrade Guide</a>, there's a <code>VCUpgrade.exe</code> located in <code>$(VSInstallDir)\common7\Tools</code>. But: <em>"... [VCUpgrade.exe is only] suitable for upgrading applications with only one project as it cannot take in solution file as input and parse solution information into project files."</em></p>
  
  <p>I also found <em>Upgrading Projects to Visual C++ 2010</em> at <a href="https://msdn.microsoft.com/en-us/library/ff660764%28v=vs.100%29.aspx" rel="nofollow noreferrer">Building Applications that Use the Windows SDK</a>. It tells me to use <code>devenv.exe /upgrade</code>. When I follow its instructions, it results in the following. There were no errors, but nothing was converted (and no log file was created).</p>
  
  <pre class="lang-none prettyprint-override"><code>!! From VS2015 Developer Command Line Prompt
  cryptopp-5.6.3&gt;devenv.exe /upgrade
  cryptopp-5.6.3&gt;dir *.vcproj *.vcxproj
  ...
  
  09/07/2015  10:36 AM            81,845 cryptdll.vcproj
  09/07/2015  10:36 AM            40,168 cryptest.vcproj
  09/07/2015  10:36 AM           205,529 cryptlib.vcproj
  09/07/2015  10:36 AM             8,885 dlltest.vcproj
  </code></pre>
  
  <p>Attempting to use <code>VCupgrade.exe</code> (even though its an incomplete solution according to the Microsoft docs) results in:</p>
  
  <pre class="lang-none prettyprint-override"><code>cryptopp-5.6.3&gt;vcupgrade cryptest.vcproj
  Microsoft (R) Visual C++ Project Convert Utility - Version 14.00.23107
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  Failed to initialize the VCProjectEngine.
  </code></pre>
  
  <p>How do I convert a solution and project files from an earlier version of Visual Studio to Visual Studio 2015?</p>
  
  <hr>
  
  <p>There's a few similar questions, but they don't cover the command line with errors like <em>"Failed to initialize the VCProjectEngine"</em> and the [unexplained] expiring trial. See, for example, <a href="https://stackoverflow.com/q/19112374">Upgrade a visual studio solution on the command line with visual studio express</a>.</p>
  
  <hr>
  
  <p>Humorously (in a morbid sort of way), Microsoft calls Visual Studio 2015 Community a free dev tool, and does not state its an expiring trial at <a href="https://www.visualstudio.com/vs-2015-product-editions" rel="nofollow noreferrer">Overview of Visual Studio 2015 Products</a> or <a href="https://www.visualstudio.com/products/visual-studio-community-vs" rel="nofollow noreferrer">Visual Studio Community</a> pages. In fact, Microsoft tells us its fully featured and free for Open Source projects (which this project is).</p>
  
  <p>I guess Microsoft lied and the lawyers buried it in the Terms of Service somewhere. More humorously, neither "trial" nor "expire" are called out or mentioned at the Terms of Service, either. See Microsoft's <a href="https://www.visualstudio.com/support/legal/dn877550" rel="nofollow noreferrer">Visual Studio Community license terms</a>.</p>
  
  <p>Not so humorously, I declined a copy of Visual Studio Professional after reviewing Microsoft's marketing literature because I <strong><em>thought</em></strong> Community edition would meet the project's needs. I hope that does not turn out to be a $500 USD mistake...</p>