To compile the Visual Studio solution file by right-clicking the Explorer

Source: Internet
Author: User
Tags visual studio 2010



After each change VC project to recompile, every time VS will generate debug database files, it takes time, so studied how to compile directly in the resource manager, but also found a solution.



The following are the registry files that apply to Visual Studio 2008, and after importing the system, right-click the. sln file will come out of the compiled menu:


Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell]
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Build Debug]
@=& compile debug using vcbuild
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Build Debug\Command]
@="cmd.exe /K \"\"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcpackages\\vcbuild.exe\" \"%1\" \"Debug|Win32\"\""
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Bulild Release]
@=& compile release using vcbuild
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Bulild Release\Command]
@="cmd.exe /K \"\"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcpackages\\vcbuild.exe\" \"%1\" \"Release|Win32\"\""


Since the beginning of Visual Studio 2010, Microsoft has replaced Visual C + + VCBuild with MSBuild, so the methods are somewhat different:


Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell]
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Build Debug]
@=& compile debug using msbuild
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Build Debug\Command]
@="cmd.exe /K \"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe /m \"%1\" /p:Configuration=Debug /t:Build\""
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Bulild Release]
@=& compile release using msbuild
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Bulild Release\Command]
@="cmd.exe /K \"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe /m \"%1\" /p:Configuration=Release /t:Build\""





VS2013 right-click to compile the CSharp project


Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.12.0\Shell]
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.12.0\Shell\Build Debug]
@=& compile debug using msbuild
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.12.0\Shell\Build Debug\Command]
@="cmd.exe /K \"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe /m \"%1\" /p:Configuration=Debug /t:Build\""
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.12.0\Shell\Bulild Release]
@=& compile release using msbuild
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.12.0\Shell\Bulild Release\Command]
@="cmd.exe /K \"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe /m \"%1\" /p:Configuration=Release /t:Build\""





VS2013 right-click to compile the CPP project


Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.vcxproj.12.0\Shell]
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.vcxproj.12.0\Shell\Build Debug]
@=& compile debug using msbuild
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.vcxproj.12.0\Shell\Build Debug\Command]
@="cmd.exe /K \"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe /m \"%1\" /p:Configuration=Debug /t:Build\""
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.vcxproj.12.0\Shell\Bulild Release]
@=& compile release using msbuild
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.vcxproj.12.0\Shell\Bulild Release\Command]
@="cmd.exe /K \"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe /m \"%1\" /p:Configuration=Release /t:Build\"" 





Other versions of VS are self-modifying the registry, which is convenient.



Note: When using MSBuild, the environment variable "Platform" is checked, and if you are not sure whether the configuration is correct, it is recommended that you remove the environment variable (Visual Studio will default to BNB when it is installed, causing MSBuild not to compile correctly, but if you start This issue does not exist if the Visual Studio IDE is compiled).



To compile the Visual Studio solution file by right-clicking the Explorer


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.