-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
slnx
support in the dotnet
CLI
#40913
Comments
Regarding the solution template, would it possible to exclude the byte order mark (BOM) now, or are there still known issues with VS or msbuild? I know that:
|
@glen-84 I'm inclined to make that change, but would like to discuss with @rainersigwald and the rest of the MSBuild team about any gaps there. |
For For |
I've reached out to the VS side to check compatibility with no-BOM. |
The VS team confirmed that slnx defaults to UTF-8 No-BOM, so we are clear to default the slnx template contents to no-BOM as well. I've updated the description to match this. |
Is there any concrete plan for this? I'm looking forward to build/test/restore support for slnx (also when referenced from a .slnf) so that we can update Sentry .NET SDK to use the new format.. Adding projects to the old format is so cumbersome when you need to keep a PR reviewable. |
We are still waiting for an official parser library for the new format to be made available by our partner teams. We're unable to make any progress without that library (and the stabilized format spec implied by that) |
related microsoft/slngen#585 |
if the plan is still to include slnx support in sdk 9.0, is there any estimate when parsing library is going to be available on github? |
Not at this time, no. |
even if it's not fully ready it can still be open sourced today and people can help fixing the remaining bugs in a few hours. someone did similar work starting five months ago https://github.com/winscripter/Slnx so they can collaborate with community |
|
Still waiting for this. |
It's not like slnx works very well in VS. It's an experimental preview feature. And even with VS, CI requires dotnet CLI. |
It's not a non-preview feature yet in VS (I believe the release notes still don't mention it at all), and the API isn't considered stable. |
A status update for those following this issue:
Our current plan is to try to merge this change and get support for building slnx files from the .NET SDK in a preview release of the 9.0.200 SDK, but that is subject to some timelines that we are still navigating. |
Proposal: In .NET 9.0, the default format ( |
@kasperk81 From the issue description:
Switching the defaults for .NET 10 is a fine plan, and is what we had been internally considering anyway. |
No I have not - I will look into that. VS 17.12 was released today. Any update on .NET 8 support for slnx by chance? |
I can tell you that in 17.12 and 17.13 P1 don't even support SLNX for jumplists properly, and the upgrade tool also doesn't work. It's a half-baked mess. |
how is this still "untriaged" ? |
The whole point of Currently, if a project file has a |
Oh boy please don't add guids back in this, that substantially defeats the purpose of the new format. |
THanks for pointing this out! You are absolutely right, this is addressed in #45366 |
It looks like .NET SDK |
Update: |
Is there an overview of which commands are still missing? |
Yes, the plan is to currently remove all instances of the previous parser and replace with vs-solutionpersistence, as well as adding discovery for .slnx files in other areas that forward to MSBuild #45442 |
I have tested latest SDK and most things are working but still we can't add files that are not project files. Are there any plans for this? |
Hello @dominikjeske yes, there are plans to introduce that feature, please refer to #9611 |
Tagging #46002 for future reference: Refactor sln(x) + add support for slnf |
@edvilme when do you expect we will see official I just wanted to keep close track of that so we can jump into it as soon as possible on our side. |
Hi @julealgon - VS today supports building with SLNX files, but the rest of the CLI-based ecosystem does not. In next month's 9.0.200 SDK release (which will ship with VS 17.13), the CLI will be able to support SLNX files as well. Other IDEs like VSCode and Rider may not yet support SLNX still - you'll need to reach out to those products to check their expected timelines. Even with 9.0.200 supporting SLNX formats, though, the VS IDE itself doesn't have the format enabled as a default. If you'd like to migrate you'll need to enable the option for every developer that will work on your solution. |
Yeah, sorry, I should've clarified I meant comprehensive support. I already did a few tests with
This is precisely what I was looking for. I appreciate you sharing that @baronfel.
Do you think it will have support enabled by default by version 17.13? The fact that we would have to ask all developers to change this setting manually does make this harder to adopt for us. If default support is coming in an even later release, we might end up waiting for that before we make the switch. |
Is there any reason it shouldn't be enabled by default in 17.13? |
The
dotnet
CLI should support the newslnx
format for building and in the existing solution management commands. It should also help interested users migrate to the new format.The new format
slnx
is an XML-based format that simplifies the currentsln
file format. When released, it will have an open-source parser, so tools like MSBuild and thedotnet
CLI can consistently operate on the format. The new format is intended to reduce common customer pains like merge conflicts and readability, but not to drastically change the experience of working with solutions.dotnet
experiences using solutionsThere are three primary ways that the
dotnet
CLI interacts with solution files todaydotnet build myapp.sln
dotnet sln myapp.sln add src/migrations
dotnet new solution -n lodestone
Each of these should be made to work with the new format to some degree. In addition, a fourth new capability should be added:
sln
toslnx
dotnet sln <sln file> migrate
Building solutions
Status: Done, will be shipping in .NET 9.0.200. Available in VS 17.13 preview 2/.NET SDK 9.0.200-preview
This should be mostly transparent to the
dotnet
CLI. Much like solutions today, building a solution involves passing the path to the solution file to the MSBuild engine, which has the sole responsibility of converting the build configurations into a 'metaproject' - a kind of MSBuild representation that MSBuild can actually execute - and then building the requested targets on that metaproject.The same process would hold with
slnx
- the CLI would forward along theslnx
file provided (if any) and MSBuild itself would translate that file into a metaproject and execute that metaproject. Very few changes should be required in the CLI codebase to support this. MSBuild's tracking issue for this is dotnet/msbuild#10266.Manipulating solution content
Status: In progress - see the linked PRs below.
The CLI has several commands that allow for adding and removing projects in a solution, as well as listing the existing projects. All of these commands should work with
slnx
as well. This is the area that will require the most investment. The CLI will need toslnx
files are valid inputs to these commandsslnx
filesThese commands allow for selection of the solution file. If invoked in a location where multiple potential solution files are present, the command should error and prompt the user to choose one of the possible solutions.
We'll also need to invest in test coverage to make sure we have parity between our
sln
support andslnx
support.Creating new solutions
Status: Done, will be shipping in .NET 9.0.200. Available in VS 17.13 preview 2/.NET SDK 9.0.200-preview
The CLI currently ships a
solution
template that create a new, barebones solution file.We should provide a template that can create an empty
slnx
file for users to begin with. The new slnx template should use UTF-8 without a BOM. One major question: should we supplant the existingsolution
template to create anslnx
file? Should the old solution format be accessible via a template parameter?Migrating existing solutions
Status: Done, will be shipping in .NET 9.0.200. Available in VS 17.13 preview 3
An entirely new capability to migrate a
sln
file to a newslnx
file should be implemented as well to ease onboarding and allow for automation. This command would load the existingsln
file and analyze it, translating it into an equivalentslnx
file. Ideally any data that matches the default conventions of the newslnx
format (for example, default build configurations likeDebug
andRelease
) could be omitted from the generatedslnx
file. The migrated slnx file will be written alongside the existing solution to allow for easy reverting/recovery of the change. The solution file to act upon will follow our existingSlnArgument
pattern - if an exact path is used, use that sln. If a directory is provided, and there is only one solution file, use that solution file. If a directory is provided and there are multiple solution files, error.Note that the addition of this slnx file will likely cause 'bare', unspecified MSBuild commands (like
dotnet build
without an explicit solution argument) as well asdotnet sln
commands with no arguments to fail when used in the working directory - this is acceptable. Users can test by explicitly building the new slnx, and then delete the previous .sln file when they are satisfied with the behaviors.References
The text was updated successfully, but these errors were encountered: