Classes (API) for parsing Visual Studio Solution File (.sln)?

Do there exist a class within Team System or MSBuild that allows typed access and parsing of Visual Studio Solution Files (.sln)?

In case not, I have to manually parse through the text file (why is it still not based on XML?).

My requirements is to get path to included project files within the .sln. Parsing the file with a text reader should be real simple, but if there was an API it's always better to use that.

[575 byte] By [Sondre-MSFTRegionalDirector] at [2008-2-7]
# 1

If there is then I'm going to be really annoyed!

I had to write my own a couple of months ago.

MichaelLuke at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 2

You can use Visual Studio Extensibility Objects (DTE) to do this. There is lot available on this in MSDN (& web).

Thanks.

GautamGoenka at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 3

you just need to add the EnvDTE assembly from the .net

there you find wrapper classes for all solution and project files. cheers, christoph

EnvDTE.SolutionClass

cheers, christoph

cmn at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 4

It is surely nice that there exists such class. I remember parsing sln files manually in VS2003.

But one thing I am suspicious of - the VS SDK help has all kinds of helpful messages (likes of "Microsoft Internal Use Only." and "This method supports the .NET Framework infrastructure and is not intended to be used directly from your code. ") all over SolutionClass.

I would appreciate if someone could provide some hands-on experience with that not-at-all-well-to-say-the-least documented class.

Regards, Eugene

eugene.z at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...

Visual Studio Team System

Site Classified