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

Solution file parser should parse and preserve ProjectSection(SolutionItems) #1708

Open
KirillOsenkov opened this issue Feb 15, 2017 · 3 comments
Labels
Area: Solution (.sln) Issues related to parsing .sln files or building solutions triaged

Comments

@KirillOsenkov
Copy link
Member

Currently the solution parser just skips over solution items, here's the code:
http://source.dot.net/#Microsoft.Build/Construction/Solution/SolutionFile.cs,775

Since the solution parser is the only public and official .sln parser it'd be nice if it supported parsing solution items, which is easy to add. Here's an example syntax:

Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E3D2D556-C8D6-4107-902F-5092299605DC}"
	ProjectSection(SolutionItems) = preProject
		nuget.config = nuget.config
		tools.proj = tools.proj
	EndProjectSection
EndProject

@rainersigwald
Copy link
Member

the solution parser is the only public and official .sln parser

. . . kind of. It was never intended as a general-purpose thing, only to meet MSBuild's needs. I'd love to see solution understanding in a separate library that we could use--if that was done, this would be an obvious feature request there. For MSBuild's internal needs, I'd say no way. But people definitely do (ab)use MSBuild for this purpose.

@rainersigwald rainersigwald added the Area: Solution (.sln) Issues related to parsing .sln files or building solutions label Feb 22, 2017
@danmoseley
Copy link
Member

danmoseley commented Mar 2, 2017

Parsing all the random solution files out there (including all the quirks of VS going back 20 years + all the quirks of randomly tool generated and hand edited solutions) is not as simple as it seems. This code has stabilized to cope with that more or less so there's certainly value in allowing this to be used in a reusable way.

@jpbruyere
Copy link

Any chance to get SolutionFolder files parsed soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Solution (.sln) Issues related to parsing .sln files or building solutions triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants