-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dotnet add project to solution command just fails starting with newest 9.x SDK #46771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@edvilme is this another example of the relative path bug that you've fixed already? If so, the fix will be in next month's release. |
Yes, when the project path gets resolved, it attempts to create solution folder ".." which as the error suggests is not valid. A fix for this has already been merged for 9.0.2xx. See #46456 |
The same error happens when you try to add a project to solution with full name: |
Yes, this is due to the relative project location being outside of the solution working directory. Hence it eventually gets resolved to ../../tmp/my.csproj |
yes, I've also noticed that this error does show up when this specific criteria is meet, however, if the reference project IS INDEED in the same parent folder, the command works with no issue |
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:
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.
The text was updated successfully, but these errors were encountered: