Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Visual Studio .NET Solution File Format

This topic is 5964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Those of you who have already worked with Visual Studio .NET know that Microsoft changed again their project file formats. While Visual C++ 6.0 needed a workspace file (.dsw) and one or more project files (.dsp), Visual C++ 7.0 .NET needs a solution file (.sln) and one or more VC project files (.vcproj). To be able to convert between the different formats or to create them on the fly, I need to know how the new solution file is structured. Here are the contents of a basic .sln file with one associated project:
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "Test.vcproj", "{A4536DB2-D21D-40A9-8CC1-15F295177EBC}"
	GlobalSection(SolutionConfiguration) = preSolution
		ConfigName.0 = Debug
		ConfigName.1 = Release
	GlobalSection(ProjectDependencies) = postSolution
	GlobalSection(ProjectConfiguration) = postSolution
		{A4536DB2-D21D-40A9-8CC1-15F295177EBC}.Debug.ActiveCfg = Debug|Win32
		{A4536DB2-D21D-40A9-8CC1-15F295177EBC}.Debug.Build.0 = Debug|Win32
		{A4536DB2-D21D-40A9-8CC1-15F295177EBC}.Release.ActiveCfg = Release|Win32
		{A4536DB2-D21D-40A9-8CC1-15F295177EBC}.Release.Build.0 = Release|Win32
	GlobalSection(ExtensibilityGlobals) = postSolution
	GlobalSection(ExtensibilityAddIns) = postSolution
The format is pretty straightforward. I'm just wondering what the function of the two GUIDs is. The first GUID (8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942) seems to be the same for all solution files I create with VC.NET. Do you get the same GUID? And do you know what its purpose is? The second GUID (A4536DB2-D21D-40A9-8CC1-15F295177EBC in this case) varies from solution to solution (or rather project to project). Is this just a random GUID to uniquely identify a project? When creating .sln files on the fly, may I use CoCreateGUID() or a similar function to create that GUID? By the way: If anybody knows of the exact file format specifications, just drop a link to it and that'd be fine. [edited by - Origin on July 18, 2002 8:36:35 AM]

Share this post

Link to post
Share on other sites
Rather than parsing this file yourself, I think you should have a look at the APIs for automating visual studio. I haven''t used these myself in VS.Net so I can''t tell for sure they have everyting you need, but I''d be surprised if you couldn''t use anything from them. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxoriExtensibilityReference.asp and also http://msdn.microsoft.com/msdnmag/issues/02/01/Bugslayer/Bugslayer0201.asp

I don''t know the answer to your questions, but I guess the file format is unsupported (guess you already figured that out, huh?). The first GUID seem to be the version of Visual Studio used when creating the solution. The second GUID seem to be exactly what you say.

OT: Don''t you find it a little bit odd that they don''t use an XML-based format?

Share this post

Link to post
Share on other sites

thanks a lot for your hints. Yeah, the file format seems to be
unsupported, that''s not surprising though. That they don''t use
XML for their new workspace file format is really odd because
they use XML for everything else now. The new project files are
also based on XML.

I browsed through the links you posted and will have a detailed
look at them later. I guess that they might help me with my
task but I''m wondering if it wouldn''t actually be easier to
parse the files on my own...

As for the GUIDs, is the first one always the same for VC++ 7.0,
i.e. does the same GUID occur in your solution files, too?

Share this post

Link to post
Share on other sites
All of my solution files share the same ''first'' GUID, but it''s different from yours. I''m guessing it''s specific to each installation of VS.NET.

Share this post

Link to post
Share on other sites

I already expected that. It''s probably part of Micro$oft''s
new "transparent user" policy... Maybe the GUID is the encoded
serial number or something like that. I''ll try and see if a
random GUID works as well. If it does, I don''t see a problem

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!