Visual Studio Team Services: create build definition for .netcore 1.1

177 Views Asked by At

I need to build a package, based on my c# code. I have already created build definition which used to work, but since .netcore 2.0 announcement on VSTS there is default sdk used with version 2.0. Unfortunatelly it is not working well with previous .netcore version.

I am using command line task for each step, just like below: restore

I am now unable to restore packages, build project or publish it. Is there a way to specify which dotnet.exe version will be executed during restoring or any other step?

I was trying to specify whole path "$(ProgramFiles)\dotnet\shared\Microsoft.NETCore.App\1.1.2\dotnet.exe" where it is installed even on vsts, I get then:restore with full path

Furthermore I was trying to setup a powershell step, but I am unable to provide a argument for it. powershell

& "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.1.2\dotnet.exe" --version

does not respond with anything. I was trying different way to provide args, but also without any success.

How to run an EXE file in PowerShell with parameters with spaces and quotes

1

There are 1 best solutions below

0
Paweł Ruciński On

Resolved for now with using dedicated Task component from vsts (nuget resore, visual studio build etc.) instead of command line - dotnet with args like restore/build/etc. Only thing that left for me is run unit tests for this app. Visual Studio test does not find any test in solution even with specified dll name.