0
votes

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
I assume you are using Hosted VS2017 agent, the .net core 1.1 project still work fine on Hosted VS2017 agent. What're tasks of your definition? What's the detail errors? Set system.debug to true and queue build, then share the detail log on the OneDrive. On the other hand, base on dotnet restore command, there isn't the option to specify version. I also tried to add .Net Core Tool Installer task (tool categroy), it uses .net core 1.1 but throws error (dotnet --version).starian chen-MSFT

1 Answers

0
votes

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.