我可以使用 MSBuild / Build Tools for Visual Studio 从命令行编译项目,而不需要 Visual Studio 吗?
May I use MSBuild / Build Tools for Visual Studio to compile projects from command line, without Visual Studio?
来自MSBuild documentation on docs.microsoft.com:
The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software. Visual Studio uses MSBuild, but MSBuild doesn't depend on Visual Studio. By invoking msbuild.exe on your project or solution file, you can orchestrate and build products in environments where Visual Studio isn't installed.'
(...)
The following examples illustrate when you might run builds by invoking MSBuild from the command line instead of the Visual Studio IDE.
- Visual Studio isn't installed. (Download MSBuild without Visual Studio.)
好的,看来 MS 希望 人们能够单独使用 MSBuild 构建项目,而无需完整的 VisualStudio IDE.
但是,当我从文档链接到的页面下载 MSBuild 时,安装程序要我接受 these license terms,其中状态:
You may install and use any number of copies of the software to use solely with Visual Studio Community, Visual Studio Professional, and Visual Studio Enterprise, to develop and test your applications.
???许可证 似乎明确禁止我 执行文档页面描述的操作!我可能不会单独使用 MSBuild - 我只能将它与 VisualStudio 一起使用。所以,我想,如果我用 VisualStudio 打开它并让 VisualStudio 在我单击 VisualStudio GUI 中的绿色箭头后调用 MSBuild,我可能只会编译一个项目??
我是不是看错了许可证?因为这似乎与 Microsoft 似乎打算允许其客户使用的内容相反!
Am I reading the license wrong? Because this seems contrary to what
Microsoft seems to intend to allow its customers!
我想你不必太担心。这意味着 Build Tool
可以与 Visual Studio Community、Professional 等一起工作--------您可以使用这个单独的构建工具来构建由 VS IDE 创建的项目。
此外,这是使用规则之一,只要满足其中一个许可,就可以直接使用Build Tool。另外一般来说,如果你有使用VS IDE(Community, Professional, Enterprise)的许可证,你可以满足许可证并直接使用Build Tool。
相信下面的规则可以让你满意。其实Build Tool就是一个编译工具。相比VS IDE,没有那么苛刻的要求。基本上用户都能满足里面列出的规则。
要使用,安装完成后打开即可,简直就是developer command prompt for VS2019的单独安装。然后键入命令行来构建您的项目。
希望对您有所帮助。
来自MSBuild documentation on docs.microsoft.com:
The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software. Visual Studio uses MSBuild, but MSBuild doesn't depend on Visual Studio. By invoking msbuild.exe on your project or solution file, you can orchestrate and build products in environments where Visual Studio isn't installed.'
(...)
The following examples illustrate when you might run builds by invoking MSBuild from the command line instead of the Visual Studio IDE.
- Visual Studio isn't installed. (Download MSBuild without Visual Studio.)
好的,看来 MS 希望 人们能够单独使用 MSBuild 构建项目,而无需完整的 VisualStudio IDE.
但是,当我从文档链接到的页面下载 MSBuild 时,安装程序要我接受 these license terms,其中状态:
You may install and use any number of copies of the software to use solely with Visual Studio Community, Visual Studio Professional, and Visual Studio Enterprise, to develop and test your applications.
???许可证 似乎明确禁止我 执行文档页面描述的操作!我可能不会单独使用 MSBuild - 我只能将它与 VisualStudio 一起使用。所以,我想,如果我用 VisualStudio 打开它并让 VisualStudio 在我单击 VisualStudio GUI 中的绿色箭头后调用 MSBuild,我可能只会编译一个项目??
我是不是看错了许可证?因为这似乎与 Microsoft 似乎打算允许其客户使用的内容相反!
Am I reading the license wrong? Because this seems contrary to what Microsoft seems to intend to allow its customers!
我想你不必太担心。这意味着 Build Tool
可以与 Visual Studio Community、Professional 等一起工作--------您可以使用这个单独的构建工具来构建由 VS IDE 创建的项目。
此外,这是使用规则之一,只要满足其中一个许可,就可以直接使用Build Tool。另外一般来说,如果你有使用VS IDE(Community, Professional, Enterprise)的许可证,你可以满足许可证并直接使用Build Tool。
相信下面的规则可以让你满意。其实Build Tool就是一个编译工具。相比VS IDE,没有那么苛刻的要求。基本上用户都能满足里面列出的规则。
要使用,安装完成后打开即可,简直就是developer command prompt for VS2019的单独安装。然后键入命令行来构建您的项目。
希望对您有所帮助。