Search code examples
c#command-linemsbuildvisual-studio-2017command-prompt

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


I have a sample WPF project and I created a Setup project to it. 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. enter image description here

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 ------

enter image description here

Regards.


Solution

  • Have reproduced same issue in my machine. And resolve it by workaround from it3xl.

    1. Create a Text Document file in desktop and copy the content from this xx.bat file into it. (for professional editon)

    2. Save and rename the text document from xx.txt to Test.bat

    3. Double click the Test.bat file, then this issue goes away when i rebuild them by devenv command.

    Hope it helps.