Skip to content

Dotnet add project to solution command just fails starting with newest 9.x SDK #46771

@xafero

Description

@xafero

Describe the bug

I very often use the add-command to add newly created projects to my solution. Now it just simply fails without any sense or reason. It would seem that it tries to take my path to a project as the name of the item-to-be-added? Crazy. Because in the past versions (I have to downgrade to .NET 8 for now), it of course reads the referenced project file and just works.

To Reproduce

c:\Code\some>dotnet sln add ..\common\Data.Forms
Names cannot:

  • contain any of the following characters: / ? : \ * " < > |
  • contain control characters
  • be system reserved names, including 'CON', 'AUX', 'PRN', 'COM1' or 'LPT2'
  • be '.' or '..' (Parameter 'name')

c:\Code\some>dotnet --list-sdks
1.1.0 [C:\Program Files\dotnet\sdk]
3.1.426 [C:\Program Files\dotnet\sdk]
5.0.408 [C:\Program Files\dotnet\sdk]
6.0.136 [C:\Program Files\dotnet\sdk]
6.0.321 [C:\Program Files\dotnet\sdk]
9.0.200 [C:\Program Files\dotnet\sdk]

Until .NET 8.0.406 at least, the same command actually works and adds my project to the solution.

Why, on Earth, did this awful change happen? Please fix this. I'm mostly working in command-line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions