{"id":3953,"date":"2010-03-25T13:07:00","date_gmt":"2010-03-25T13:07:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2010\/03\/25\/to-the-command-line-enthusiasts-some-quick-know-hows-for-upgrading-to-vs-2010\/"},"modified":"2019-02-18T18:45:35","modified_gmt":"2019-02-18T18:45:35","slug":"to-the-command-line-enthusiasts-some-quick-know-hows-for-upgrading-to-vs-2010","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/to-the-command-line-enthusiasts-some-quick-know-hows-for-upgrading-to-vs-2010\/","title":{"rendered":"To the command line enthusiasts: Some quick know-hows for Upgrading to VS 2010"},"content":{"rendered":"<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">Hello, I am Renin John, a Software Development Engineer in Test from the VC++ Project and Build team. I am aware that some of you prefer to do your daily work from the command prompt rather than from the IDE. I thought it would help if I put together instructions for the same using the knowledge I acquired testing Project Conversion.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">In order to perform an upgrade from a prior version of Visual Studio (VC6 through VS 2008) through the command line, you could use one of the following tools:<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\"><\/p>\n<p><\/font><\/font><\/span>&nbsp;<\/p>\n<p class=\"MsoListParagraph\"><span><span><font face=\"Calibri\" size=\"3\">1.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><span><font size=\"3\"><font face=\"Calibri\">devenv.exe<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><span><font face=\"Calibri\" size=\"3\">2.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><span><font size=\"3\"><font face=\"Calibri\">VCUpgrade.exe<\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\"><\/p>\n<p><\/font><\/font><\/span>&nbsp;<\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">They&rsquo;ll come in handy even if you&rsquo;re thinking of scripting the conversion process.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><b><span><span><font face=\"Calibri\" size=\"3\">1.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><\/b><font size=\"3\"><font face=\"Calibri\"><b><u><span>DevEnv.exe:<\/span><\/u><\/b><\/font><\/font><\/p>\n<p class=\"MsoListParagraph\"><font size=\"3\"><font face=\"Calibri\"><b><u><span><\/span><\/u><\/b><b><span><\/p>\n<p><\/span><\/b><\/font><\/font>&nbsp;<\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">Like in the previous versions, you could upgrade using the devenv.exe command: just invoke it with the &ldquo;\/upgrade&rdquo; switch. The location of devenv.exe is specified by the DevEnvDir environment variable in the VS 2010 command prompt window.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><i><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/i><\/p>\n<p class=\"MsoListParagraph\"><font size=\"3\"><font face=\"Calibri\"><i><span>Command<\/span><\/i><span>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a) To upgrade solution file: <b>devenv.exe \/upgrade &lt;solution file (.sln)<\/b>&gt;; or<\/p>\n<p><\/span><\/font><\/font><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;b) To upgrade project file: <b>devenv.exe \/upgrade &lt;project file (.vcproj)<\/b>&gt;<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">This command will generate a log file named UpgradeLog.XML (UpgradeLog2.XML if UpgradeLog.XML already exists, UpgradeLog&lt;n+1&gt; if UpgradeLog&lt;n&gt; already exists, where n=2,3,&hellip;) at\n the end of conversion, that will contain the detailed list of errors\/warnings from the conversion of the solution\/project files.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><font size=\"3\"><font face=\"Calibri\"><b><u><span>Note<\/span><\/u><\/b><b><span>: <\/span><\/b><\/font><\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span><font face=\"Calibri\" size=\"3\">i)<\/font><span>&nbsp;&nbsp;<\/span><\/span><\/span><span><font size=\"3\"><font face=\"Calibri\">Conversion on the command line using devenv.exe is not supported for VC6.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><span><font face=\"Calibri\" size=\"3\">ii)<\/font><span> <\/span><\/span><\/span><span><font size=\"3\"><font face=\"Calibri\">Since the devenv.exe command is not available in the VC Express SKU, this form of conversion is not applicable here.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">Hence for the above two cases, you would need to stick to the VS IDE. However, if it&rsquo;s for a single project file, you have the option of using VCUpgrade.exe (described below).<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><b><span><span><font face=\"Calibri\" size=\"3\">2.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><\/b><b><u><span><font size=\"3\"><font face=\"Calibri\">VCUpgrade.exe<\/font><\/font><\/span><\/u><\/b><\/p>\n<p class=\"MsoListParagraph\"><b><u><span><font size=\"3\"><font face=\"Calibri\"><\/p>\n<p><\/font><\/font><\/span><\/u><\/b>&nbsp;<\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">This is a new tool introduced in VS 2010. It is located in the directory specified by the VS100COMNTOOLS environment variable in the VS 2010 command prompt window. <\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">It is going to be included in the next release of WinSDK, so the users will be able to convert their SDK based samples even if they do not have devenv.exe or rather, Visual Studio installed.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><i><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/i><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><i><span>Command<\/span><\/i><span>: <b>vcupgrade.exe &lt;project file (.dsp\/.vcproj)&gt;<\/p>\n<p><\/b><\/span><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">The conversion results will be displayed in the command window once the conversion is complete.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">If you are re-converting your project file, invoke VCUpgrade with the &ldquo;\/overwrite&rdquo; switch, otherwise the existing files will not be replaced.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><b><u><span>Note<\/span><\/u><\/b><b><span>:<\/span><\/b><span> This tool has some limitations and cannot be used to convert solution files. It is recommended only for single project files: those which do not contain project to project references, and whose solution files do not contain project dependencies as this information from the solution will be lost during conversion (This is because, in VS 2010, solution dependencies are converted into project-to-project references). Use the devenv.exe tool (explained earlier) instead in these other cases, which is generally more preferred over VCUpgrade.<\/p>\n<p><\/span><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><b><u><span><font size=\"3\"><font face=\"Calibri\">Reversing the upgrade:<span class=\"MsoSubtleReference\"><\/p>\n<p><\/span><\/font><\/font><\/span><\/u><\/b><\/p>\n<p class=\"MsoListParagraph\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><span><font face=\"Calibri\" size=\"3\">a)<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><u><span><font size=\"3\"><font face=\"Calibri\">If you did a solution file upgrade:<\/p>\n<p><\/font><\/font><\/span><\/u><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">Go to the directory containing the solution and run:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">del \/S *.vcxproj* *.props<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">del *.sln UpgradeLog*.XML<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">move Backup*.sln .<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Calibri\">for \/F %B in (&lsquo;dir \/B Backup*&rsquo;) do rd \/S \/Q %B<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">rd \/S \/Q _UpgradeReport_Files<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><span><font face=\"Calibri\" size=\"3\">b)<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><u><span><font size=\"3\"><font face=\"Calibri\">If you did a project file upgrade:<\/p>\n<p><\/font><\/font><\/span><\/u><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">Go to the directory containing the project file and run:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">del \/S *.vcxproj* *.props<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">del UpgradeLog*.XML<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">rd \/S \/Q _UpgradeReport_Files<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">You could just throw these commands into a batch file and let it take care of this for you (Replace %B above with %%B if in the batch script).<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><b><u><span>Note<\/span><\/u><\/b><b><span>: <\/span><\/b><span>If the directory containing the particular solution\/project contains other solution\/project files that you do not want to have deleted, please modify the commands accordingly. Also, if your project uses &ldquo;.props&rdquo; files located somewhere outside this directory, take care to delete those files as well.<\/p>\n<p><\/span><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">Hope you enjoyed this blog. Do let me know if you have any questions\/comments.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p>&nbsp;<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, I am Renin John, a Software Development Engineer in Test from the VC++ Project and Build team. I am aware that some of you prefer to do your daily work from the command prompt rather than from the IDE. I thought it would help if I put together instructions for the same using the [&hellip;]<\/p>\n","protected":false},"author":289,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[79,53,49,51,41],"class_list":["post-3953","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-automation","tag-command-line","tag-conversion","tag-upgrade","tag-vs2010"],"acf":[],"blog_post_summary":"<p>Hello, I am Renin John, a Software Development Engineer in Test from the VC++ Project and Build team. I am aware that some of you prefer to do your daily work from the command prompt rather than from the IDE. I thought it would help if I put together instructions for the same using the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/3953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/289"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=3953"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/3953\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=3953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=3953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=3953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}