question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sln add globbing patterns fail

See original GitHub issue

This pertains to dotnet/docs dotnet/sdk#5373

Per the documentation this should work.

It is not clear if this is a bug or a documentation problem.

Steps to reproduce

Given the following file structure:

. ├── Api │   ├── Api.csproj │   ├── Controllers │   └── wwwroot ├── complex-solution.sln ├── Data │   └── Data.csproj ├── Domain │   └── Domain.csproj └── Logging └── Logging.fsproj

Add projects to my solution using blobs: dotnet sln complex-solution.sln add **/*

Expected behavior

The output for the first task should look something like:

Project `Api/Api.csproj` added to the solution.
Project `Data/Data.csproj` added to the solution.
Project `Domain/Domain.csproj` added to the solution.
Project `Logging/Logging.fsproj` added to the solution.

Actual behavior

Output from first task:

Project `Api/Controllers` does not exist.
Project `Api/obj` does not exist.
Project `Api/wwwroot` does not exist.
Project `Data/obj` does not exist.
Project `Domain/obj` does not exist.
Project `Logging/obj` does not exist.
.NET Add project(s) to a solution file Command

Usage: dotnet sln <SLN_FILE> add [options] [args]

Arguments:
  <SLN_FILE>  Solution file to operate on. If not specified, the command will search the current directory for one.

Options:
  -h|--help  Show help information

Additional Arguments:
 Add a specified project(s) to the solution.

The end result is that nothing is adde to the solution:

dotnet sln complex-solution.sln list

No projects found in the solution.

Side note

The commands work fine when I substitute **/* with **/*.{csproj,fsproj}

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     fedora
 OS Version:  24
 OS Platform: Linux
 RID:         fedora.24-x64
 Base Path:   /opt/dotnet/sdk/1.0.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
livarcocccommented, Nov 25, 2017

Globbing is actually a feature of the shell and not of the CLI. For instance, you get globbing at bash, because bash implements it, we have no intention of adding our own globbing at the CLI.

0reactions
Rudithuscommented, Nov 27, 2017

Yes I’ve just tried it on bash and globbing is working as expected. It’s weird because ls **/*.csproj command is working fine on powershell. I would have thought this meant it would work for dotnet cli aswel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet sln command - .NET CLI
The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file.
Read more >
How to add all projects to a single solution with dotnet sln?
For Windows, open PowerShell and run this command to add all projects to the solution file: dotnet sln add (ls -r **/*.csproj).
Read more >
dotnet sln add - Nyami
sln add **/*.csproj I was presented with the error Could not find project or directory **/*.csproj . It turns out that globbing is...
Read more >
.NET Core solution management via the command line interface
Note: If you're using a Linux/Unix based shell you can do this in a single command using a globbing pattern! # /src/ $...
Read more >
Decreasing Solution Build time with Filters - Kaylumah
The problem is the management of multiple solutions filters because the filters are inclusive with relative paths following the sln-filter ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found