This article describes how to run Visual Studio compiled projects using the command line.
1. Introduction to devenv
devenv is an executable program of Visual Studio. It is generally used to run Visual Studio under "..\Microsoft Visual Studio 12.0\Common7\IDE".
Use devenv to compile an instance of the project:
devenv D:\Build\MyProject\Src\ /Build "Debug|x64"
2. Help for using devenv
1. How to get help with usage
existcmdEnter devenv /?
2. Contents of use help
The following are detailed help content:
usage:
devenv [Solution File | Project File | Any File.Extension] [Switch]
The first parameter of devenv is usually a solution file or project file.
If you want the file to be opened automatically in the editor,
Any other file can also be used as the first parameter. When you enter the project file, the IDE
The project file is found in the parent directory of the project file.
.sln file with base name. If such a .sln file does not exist,
The IDE will look for a single .sln file that references the project. If there is no such single
.sln file, then the IDE will create an unsaved with the default .sln file name
The solution has the same base name as the base name of the project file.
Command line generation:
devenv solution file.sln /build [ Solution Configuration ] [ /project project name or file [ /projectconfig name ] ]
Available command line switches:
/Build uses the specified solution configuration to generate a solution or project. For example, "Debug". If multiple platforms are possible, the configuration name must be enclosed in quotes and includes the platform name. For example, "Debug|Win32".
/Clean Delete the generated result.
/Command Start the IDE and execute the command.
/Deploy Generate and deploy the specified build configuration.
/Edit Opens the specified file in the running instance of this application. If there is no running instance, start a new instance with a simplified window layout.
/LCID Sets the default language used in the IDE for the user interface.
/Log Logs IDE activity to the specified file for troubleshooting.
/NoVSIP Disables the VSIP developer license key for VSIP testing.
/Out Appends the generated log to the specified file.
/Project Specifies the project to be generated, cleaned, or deployed. Must be used with /Build, /Rebuild, /Clean, or /Deploy.
/ProjectConfig Rewrite Solution The project configuration specified in the configuration. For example, "Debug". If possible
For multiple platforms, the configuration name must be enclosed in quotes and includes the platform name. For example, "Debug|Win32". Must be used with /Project.
/Rebuild Clean up first, and then use the specified configuration to generate the solution or project.
/ResetAddin Removes the command and command user interface associated with a specific add-in.
/ResetSettings Restores the default settings of the IDE and can also reset to the specified VSSettings file.
/ResetSkipPkgs Clear all SkipLoading tags added to VSPackages.
/Run Compile and run the specified solution.
/RunExit Compile and run the specified solution and then close the IDE.
/SafeMode Starts the IDE in safe mode, loading the minimum number of windows.
/Upgrade Upgrade project or solution and all projects in it. And create a backup of these files accordingly. For more information about the backup process, see the help on the Visual Studio Conversion Wizard.
Product specific switches:
/componentsDiff Compare two component folders. Three parameters are required: OptionalTfsServerCollectionUri SourceVersionedServerFolderPath TargetVersionedServerFolderPath If OptionalTfsServerCollectionUri is not provided, try to use the current collection of TFS projects.
/debugexe Opens the specified executable file to be debugged. Pass the remainder of the command line as a parameter to this executable.
/diff compares two files. Four parameters are adopted: SourceFile, TargetFile, SourceDisplayName (optional), TargetDisplayName (optional)
/openProjects /scc:git Open the submitted project from Git.
parameter:
/repositoryUrl (/repo):
/commitId (/id):
/project:
/solution (/sln):
/displayId:
/timestamp:
/comment:
/author:
/openProjects /scc:tfs Open the version control project from tfs.
parameter:
/collection (/col):
/version:
/project:
/solution (/sln):
If OptionalTfsServerCollectionUri is not provided,
Try using the current collection of TFS projects.
/sqldbaction Start SQL Server Data Tools and perform the action specified in the argument string.
/TfsLink Open Team Explorer and launch viewer for the provided project URI
(If a project URI is registered).
/useenv Use PATH, INCLUDE, LIBPATH, and LIB environment variables
Instead of using C++ generated IDEA paths.
To attach a debugger from the command line, use:
-p <pid>
The above method of using devenv to compile projects on the command line is all the content I share with you. I hope you can give you a reference and I hope you can support me more.