[英]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解决它。
Create a Text Document file in desktop and copy the content from this xx.bat file into it. 在桌面中创建一个文本文档文件,并将内容从此xx.bat文件复制到其中。 (for professional editon)
(用于专业编辑)
Save and rename the text document from xx.txt to Test.bat
保存并将文本文档从xx.txt重命名为
Test.bat
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.