简体   繁体   English

如何使用命令行构建 Visual Studio 安装项目?

[英]How to build Visual studio Setup project using command-line?

I have a sample WPF project and I created a Setup project to it.我有一个示例 WPF 项目,并为它创建了一个安装项目。 Now I want to build the project and Setup project through the command line.现在我想通过命令行构建项目和安装项目。

I tried with this我试过这个

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe

C:\Users\nandh\source\repos\CommendApp\CommendApp\CommendApp.csproj

command for build the project file it is successfully worked.用于构建项目文件的命令已成功运行。 在此处输入图像描述

Then use with然后使用

devenv /build Debug 

"C:\Users\nandh\source\repos\CommendApp\CommendApp.sln" /project

"C:\Users\nandh\source\repos\CommendApp\App\App.vdproj" /projectconfig
Debug

for build the setup project it shows error.对于构建安装项目,它显示错误。

 ------ Starting pre-build validation for project 'App' ------ ERROR: An error occurred while validating. HRESULT = '8000000A' ------ Pre-build validation for project 'App' completed ------

在此处输入图像描述

Regards.问候。

Have reproduced same issue in my machine. 在我的机器上重现了同样的问题。 And resolve it by workaround from it3xl . 并通过解决方案it3xl解决它。

  1. Create a Text Document file in desktop and copy the content from this xx.bat file into it. 在桌面中创建一个文本文档文件,并将内容从此xx.bat文件复制到其中。 (for professional editon) (用于专业编辑)

  2. Save and rename the text document from xx.txt to Test.bat 保存并将文本文档从xx.txt重命名为Test.bat

  3. Double click the Test.bat file, then this issue goes away when i rebuild them by devenv command. 双击Test.bat文件,然后当我用devenv命令重建它们时,此问题消失了。

Hope it helps. 希望能帮助到你。

Here is my build.bat script using Visual Studio Installer Projects Extension in Visual Studio 2022. Hope it helps someone.这是我在 Visual Studio 2022 中使用 Visual Studio 安装程序项目扩展的build.bat脚本。希望它对某人有所帮助。

@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set "{{=setlocal enableDelayedExpansion&for %%a in (" & set "}}="::end::" ) do if "%%~a" neq "::end::" (set command=!command! %%a) else (call !command! & endlocal)"
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

del build.log

%{{%
    "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe"
    XXXX.sln
    /out build.log
    /build Release  
    /project XXX.Setup\XXX.Setup.vdproj
    /projectconfig Release
%}}%

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从命令行运行 Visual Studio 安装项目 - How to run the Visual Studio setup project from Command Line 通过命令行构建 Visual Studio 项目 - Build Visual Studio project through the command line 如何自动化(从命令行)安装 Visual Studio Build Tools 构建环境,适用于 C++、.NET、C# 等 - How to automate (from command-line) the installation of a Visual Studio Build Tools build environment, for C++, .NET, C#, etc 从命令行在2017 Visual Studio中构建项目? - Build project in 2017 Visual Studio from the command line? Visual Studio - 使用命令行更新项目服务引用 - Visual Studio - Update project service reference using command line 如何使用Visual Studio“命令行参数”选项将C#项目的stdout重定向到文件 - How to redirect stdout of a C# project to file using the Visual Studio “command line arguments” option .Net Core Visual Studio 项目命令行构建与右键构建相同 - .Net Core Visual Studio project command line build same as right-clicking build Visual Studio安装项目 - Visual Studio Setup Project 如何为现有的Unity项目设置Visual Studio? - How to setup Visual Studio for existing Unity project? 如何通过visual studio安装项目降级程序? - How to downgrade program by visual studio setup project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM