Skip to content
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

SlnFile or similar API should be public #28516

Open
hknielsen opened this issue Oct 12, 2022 · 3 comments
Open

SlnFile or similar API should be public #28516

hknielsen opened this issue Oct 12, 2022 · 3 comments
Labels
Milestone

Comments

@hknielsen
Copy link

Is your feature request related to a problem? Please describe.

Im looking for a Sln file generator, and maintance library, to create sln, and add/remove projects + configurations.

As I know that dotnet new sln -o ... was doing most of this, I was hoping there were a public API somewhere to share the logic, for future changes and handling.

SlnFile that is used by dotnet new sln... and ect. should be extracted to a nuget package.
I see two copies of the class just in the dotnet github org
https://github.com/search?q=org%3Adotnet+%22class+SlnFile%22&type=code

Describe the solution you'd like

Extract SlnFile, or something similar to a nuget package that other systems also uses so we can share the logic.
Microsoft.Build would maybe be a suitable place.

Additional context

Add any other context or screenshots about the feature request here.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-CLI untriaged Request triage from a team member labels Oct 12, 2022
@baronfel
Copy link
Member

Solution file parsing is also available in the existing MSBuild packages in the Microsoft.Build.Construction namespace I believe. I would lean on that for your work, as that's actually supported. I would expect any other code you find to be domain-specific to their respective tools.

@hknielsen
Copy link
Author

hknielsen commented Oct 12, 2022

@baronfel Yes SolutionFile.Parse can do Sln file parsing/reading. But adding project's or configurations to the solution, and writing down the solution again is lacking, compared to the SlnFile class.

I would like to, from code:

  • Create Sln
  • Add/Remove projects
  • Update Configurations
  • Write down the sln, or get the SolutionFile content in text

Currently I dont see I can do that with Microsoft.Build or other public API? The closest I see is the SlnFile thats used by the cli

@dsplaisted dsplaisted added needs team triage Requires a full team discussion and removed untriaged Request triage from a team member labels Nov 9, 2022
@dsplaisted dsplaisted removed their assignment Nov 9, 2022
@marcpopMSFT marcpopMSFT removed the needs team triage Requires a full team discussion label Nov 9, 2022
@marcpopMSFT marcpopMSFT added this to the Backlog milestone Nov 9, 2022
@marcpopMSFT
Copy link
Member

Realistically, the solution file format is actually owned by Visual Studio. We'll share the feedback with them as we'd like if they made it open source and provided apis that we could use as well but for now, they don't have plans to afaik.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants