Azure Devops Pipeline - Use Microsoft Visual Studio Installer Projects - azure-devops

I'm using Azure devops with the VM = vmImage: 'windows-2019' and I would like to know how to generate an MSI file from my vdproj.
In my local visual studio I have the extension "Microsoft Visual Studio Installer Projects" installed and it works fine. But in the VS2019 of the hosted agent from Azure pipeline I dont have, and I can't generate the msi as an artifact.
I've tried to run by devenv.exe cmd but as I dont have the extension it didnt work.
Is there any way to generate msi files from azure pipeline? I've tried different ways, some custom tasks but it didnt work.
Or can I change my setups to another type of project that the MsBuild reconigze?
My error:
The project file "xxx.vdproj" is not supported by MSBuild and cannot be built.
Cheers.

Component.VSInstallerProjects v: 0.9.9 is now installed on the Microsoft-hosted agent 2019.

The project file "xxx.vdproj" is not supported by MSBuild and cannot
be built.
For this issue ,that because Visual Studio Installer Projects extension is not installed on the Hosted agent. You can view this link for a list of software installed on Microsoft-hosted agent2019.
As a work around , you have to configure your own build agent to run the build.
Make sure the VS Installer Projects extension is installed on your own build agent and then you can build the setup project either use command line task with "devenv" or use the "Build VS Installer" task.
To Build .msi file by VS installer project, you can use Build VS Installer task in marketplace.
You can specify to build .sln or .vdproj to generate .msi file(s) in Task-mode option.
Here are the similar cases:1,2 , you can refer to .

Related

Compiling VSTS Extension in VisualStudio 2017

How to build a VSTS extension in Visual Studio 2017. The post build event configured in package.json doesn't work from Visual Studio.
Only the Command npm run build triggers the build and postbuild events. I want vsix file to be created on building the VisualStudio 2017 project.
We cannot build directly to generate the vsix file in VS. Just as you said we can only trigger the postbuild events to call the command tfx extension create --manifest-globs vss-extension.json to package it.
To create TFS/VSTS extensions, you can refer to this article for detials :Create your first extension with Visual Studio
To package as the vsix file, please see Packaging and publishing - Package
If you mean create Visual Studio VSIX Package, then you can reference below articles:
Creating Your First Visual Studio VSIX Package
Visual Studio Extensibility: Creating Visual Studio VSIX package
extension

Powershell project in visual studio

How do I open a powershell project in visual studio. The project was created in GitLab originally and then put in VSTS, am able to clone it to my local machine but do not see an option to open the project. VS2015 is looking for a soln file or similar files. Am guessing because the project was not initially built in VS2015?

Nuget for PowerShell Projects in Visual Studio

How can I install nuget packages for my PowerShell Projects in Visual Studio 2015? I have tried to do it with both the PowerShell Module Project and PowerShell Script Project. I have installed PowerShell Tools for Visual Studio 2015.
When I open these projects, the Default project in the Package Manager Console is empty. Here is a screenshot of what I mean.
When I try to install a nuget package, e.g. Pester, I get the following error.
I know this thread might be outdated and is rather old but my older article with some possible solutions might help here. I tested current state and still, no support inside VS 2015 for PowerShell project and NuGet packages together.
the current state is :
go with https://chocolatey.org/ and install it on your dev box (and CI) => you install pester globally with : choco install pester and update it if needed.
use old packages.config and update by hand version number and run nuget restore (nuget update will no longer work for this type of solution).
version whole pester into repo and call it directly. you can use nuget install pester for this (if you have nuget in path somewhere)
The link : http://rostacik.net/2015/12/16/how-to-use-nuget-packages-even-with-powershell-projects-with-visual-studio-2015/

Use Specific Roslyn Compiler Version in TeamCity

Due to a bug in the Roslyn compiler, I cannot build my project using v1.0 of the compiler (there is no workaround to make it work on 1.0). However, Microsoft has corrected the issue in a more recent version of the compiler.
When using Visual Studio, you can use a specific version of the compiler by adding the NuGet package available from https://www.nuget.org/packages/Microsoft.Net.Compilers/ to your project. This causes Visual Studio to use the specified version of the compiler when building the project.
However, when attempting to run a build on TeamCity, it does not seem to know to use the new version of the compiler. It only allows one to choose which version of Visual Studio to use. Is there any way to specify to TeamCity which version of the compiler to use manually?
Note: I am using TeamCity Professional 9.1.3 (build 37176) and in the build step I have chosen Visual Studio 2015.
When built locally, the build is done using:
D:\BitBucket\LocalPackages\Microsoft.Net.Compilers.1.1.0-beta1-20150928-02\build\..\tools\csc.exe /noconfig /nowarn:1701,1702,2008 ....
But when built on TeamCity, the log shows:
[Csc] C:\Program Files (x86)\MSBuild\14.0\bin\csc.exe /noconfig /nowarn:1701,1702 .....
I have also confirmed that the package is installed as part of the TeamCity build (prior to the csc command):
[Exec] Installing 'Microsoft.Net.Compilers 1.1.0-beta1-20150928-02'.
Is this just a symptom of how NuGet can behave differently in the Visual Studio UI vs. Command line? And if so, is there a workaround?
Update:
I never did figure it out. Running the build in Visual Studio on the build server worked perfectly, but running the build using the exact same files through TeamCity did not work.
However, Microsoft released VS2015 Update 1, which resolves my original issue, though not this specific problem.
The Microsoft.Net.Compilers package is using the standard Nuget tooling. Specifically, there is a build folder in the package, which contains a props file. This props file gets injected into the csproj file, and is responsible for changing the csc executable to the one in the package.
If you are using msbuild 14, then the .props file is changing the CscToolPath, and the CscToolExe to point to the csc.exe in the package. So you just have to make sure that TeamCity is using msbuild 14.
Which version of TeamCity are you using? The documentation of 9.1 says that it supports msbuild 14 (msbuild 2015). If you are on older version, you could still use msbuild 14 from the command line runner.

How do I create a deployment package for CodedUI Tests recorded in Visual Studio 2010 beta?

A few test scenarios have been recorded using CodedUI test template for my web application in Visual Studio 2010 beta. These run from within the Visual Studio successfully without any issues. I was looking for instructions to create a deployment package.
Configure an environment with a "standalone" MSTest
A series of new test tools is being introduced with Visual Studio 2010. Team Agents provides a very small footprint and includes MSTest (it will be installed in a Visual Studio path).
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe
You can copy the contents of your test project(s) bin\ directory to the machine with Team Agents installed and execute MSTest against your test container.
mstest /testcontainer:x:\test-project\automated-tests.dll"
Coded UI tests use namespaces within libraries that are part of Visual Studio e.g. Microsoft.VisualStudio.TestTools.UITesting
This is unlike UI Automation which is part of the core .NET framework e.g.
System.Windows.Automation
Therefore as I understand it you cannot package Coded UI tests to run in an environment that does not have Visual Studio installed.