'Getting .Net run to continue to next task in pipeline
I'm trying to add a run task using the .Net Core task but after it shows that the app is up on a localhost, it can't move onto the next task. I believe it doesn't move onto the next task because the .Net task never ends. I want the task to run so that it is up on the localhost and then move onto the next task to test it. here's my pipeline
trigger:
- development
pool:
vmImage: 'windows-latest'
resources:
repositories:
- repository: e2ecypress
type: git
name: devopsapp/e2ecypress
jobs:
- job: build_unit_tests
displayName: '.Net Build & Unit Test'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: DotNetCoreCLI@2
inputs:
command: 'run'
projects: '*/*.csproj'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
Solution 1:[1]
I assume DotNetCoreCLI@2 just calls "dotnet run". If your program is a console program that "never ends", then I would indeed expect your pipeline to block there.
To start your program without blocking, I think that instead of using DotNetCoreCLI@2, you need to insert a "- script" that calls the Windows "start" command to directly call "dotnet run".
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Conrad Albrecht |
