DotNetCoreCLI@2 breaks when the projects is given a path starting with the dot
See original GitHub issueRequired Information
Question, Bug, or Feature?
Type: Bug
Enter Task Name: DotNetCoreCLI@2
list here (V# not needed):
https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/DotNetCoreCLIV2
Environment
-
Server - TFS on-premises
- If using TFS on-premises, provide the version: Dev17.M153.3
-
Agent - Private
name | value |
---|---|
Agent.Version | 2.153.1 |
Agent.OS | Windows_NT |
Agent.OSArchitecture | X64 |
Agent.OSVersion | 10.0.14393 |
Issue Description
I have the following yaml template reused by many projects:
parameters:
BuildConfiguration: Debug
projects: ['*.sln']
workingDirectory: '.'
steps:
- ${{ each project in parameters.projects }}:
- task: DotNetCoreCLI@2
displayName: Build ${{ project }}
inputs:
command: 'build'
projects: ${{ parameters.workingDirectory }}\${{ project }}
arguments: '-c ${{ parameters.BuildConfiguration }}'
When the workingDirectory is omitted, ‘.’ is used. But the task breaks in this case:
##[debug]adjustedPattern: 'd:\_wf\06\20\s\.\*.sln'
##[debug]0 matches
##[debug]0 final results
##[debug]task result: Failed
##[error]Project file(s) matching the specified pattern were not found.
This template parameter is a new addition, I added it because we have some projects that have not been moved out of the one big monolithic repo, but it seems that the straightforward approach does not work, forcing me to do ugly hacks.
Task logs
Error logs
##[debug] d:\_wf\06\20\s\DBScriptSplit\Mono.Options.cs (file)
##[debug] d:\_wf\06\20\s\DBScriptSplit\Program.cs (file)
##[debug] d:\_wf\06\20\s\DbScriptSplit.sln (file)
##[debug] d:\_wf\06\20\s\Directory.Build.props (file)
##[debug] d:\_wf\06\20\s\Directory.Build.targets (file)
##[debug] d:\_wf\06\20\s\Directory.Build.Template.props (file)
##[debug] d:\_wf\06\20\s\nuget.config (file)
##[debug]194 results
##[debug]found 194 paths
##[debug]applying include pattern
##[debug]adjustedPattern: 'd:\_wf\06\20\s\.\*.sln'
##[debug]0 matches
##[debug]0 final results
##[debug]task result: Failed
##[error]Project file(s) matching the specified pattern were not found.
##[debug]Processed: ##vso[task.issue type=error;]Project file(s) matching the specified pattern were not found.
##[debug]Processed: ##vso[task.complete result=Failed;]Project file(s) matching the specified pattern were not found.
##[section]Finishing: Build *.sln
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Azure CI Pipeline - DotNetCoreCLI@2 Task error
I've had a smiller issue but with .netcore 2.2. The problem was that the test tries to build before the test starts restoring...
Read more >DotNetCoreCLI@2 - .NET Core v2 task - Microsoft Learn
Use when command = publish. Add project's folder name to publish path. Default: true. #packagesToPush: '$(Build.ArtifactStagingDirectory)/*.
Read more >How to Create a Multi-Stage Pipeline in Azure DevOps
In the window that opens, select the branch and the path to the YAML file for your pipeline. The path dropdown will pick...
Read more >Run Unit Tests to your Xamarin apps using Azure DevOps
Forms application as example. Doing some Unit Tests in your project is essential because it: ensures not to break previous feature. ensures a ......
Read more >Task dotnetcorecli 2
MarkKharitonov changed the title DotNetCoreCLI@2 does not handle correct when the projects is given a path starting with the dot DotNetCoreCLI@2 breaks when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@MarkKharitonov Yes, VS IDE will let you establish order between projects. I understand you need to establish an order between solution files as well. I am able to reproduce the issue that workingDirectory is not being honored for
build
. Apologies for the inconvenience, we’ll be working on it actively and rolling out the fix as soon as possible. ThanksClosing this issue as the DotNetCoreCLI@2 projects path should be minimatch pattern and working directory input is used for running the dotnet command. The working directory help text has also been update for the same.