After my team decided to incorporate Azure Pipelines on existing projects, one of the most difficult parts of the task for me was to look for the right pipeline task that would compile the setup project (vdproj) present in my solution using a pipeline.
After a lot of research and hours of testing, I found a way to achieve it.
Just use a command line task and use a script in the format shown below to compile the solution
"<full path to devenv.exe" "<full path to solution file (.sln)>" /Rebuild "<configuration>|<platform>"
Executing this task would compile all the projects present in the solution file, including setup projects. The outcome of setup projects like EXE and MSI files could be found in the configured the output path
If you have a requirement of compiling the solution as an administrator, then that's easy too. Just create a shortcut of devenv.exe as an admin in any desired location, and use that path in the command line given above.
Let me know if it helped you!
Top comments (13)
I tried this but no luck.
Getting error "An error occurred while validating. HRRESULT = '8000000A'"
Hi, could you pls share some more information, like what command you used, or what task you used?
Here you go -
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe" MyApp.sln /Rebuild "Release|Any CPU" /Project "Setup/MyStep.vdproj"
The command looks fine but I suspect the last two arguments you're passing "/Project" and "Setup/MyStep.vdproj" could be causing the issues.
One way to test the correctness of your command is that you run it on a command prompt. Can you pls verify it?
I ran this on command prompt locally first and getting same error.
If you're getting the same error in command prompt, it means that the command you're passing is not right. Can you ommit the last two parameters and then run? It should build the solution and generate a build for the Setup Project.
Because I'm not aware why those two parameters are needed.
Tried without /Project but still same.. ☹️
/Project is a valid switch for devenv.. check this - docs.microsoft.com/en-us/visualstu...
Sometimes things like these get strange. I wanted to know, if you're able to build the solution, by simply right-clicking the solution file in Solution Explorer? Because there's no difference between actually building a solution by hand like this and doing it via command line. As both are going to do the same job.
Yes I am able to build the solution in Visual Studio..
Try this out, if you're still facing it. I once faced it and the link below helped me
stackoverflow.com/a/45580775/3978980
I have a vdProj setup project, and unable to build setup project from .vdproj in Azure DevOps.
I need to create an msi package from this pipeline. But looks like i might need some private extension like the following which is not supporting as of now. Are there any workarounds?
marketplace.visualstudio.com/items...
could you give an example of how you fill your command line?
What do you write in configuration and platform?
Here it is:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe "D:\SourceCode\MyApp\MyApp.sln" /Rebuild "Release|x86"