views:

40

answers:

3

I'm working on a project that will require me to take various .vbproj and .csproj files and determine which version of Visual Studio they were built with and then to get information such as the output dll name etc.

Does anyone know if there is a schema available for these files? Google and MSDN searches are coming up a bit blank.

Visual Studio Versions

I should also note that I need this for the following versions of Visual Studio

  • Visual Studio 2003 (VB Language Only)
  • Visual Studio 2005 (VB and C#)
  • Visual Studio 2008 (VB and C#)
  • Visual Studio 2010 (VB and C#)
A: 

If you edit a project file (unload, then open the file as XML), you'll see in the Schemas property in the Property Grid which schemas are being used.

John Saunders
Yes, I can see the schema, but that doesn't link me to an actual XSD that I can work with
Mitchel Sellers
+2  A: 

Most of the schemas used by VS live in your equivalent of,

C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas

the ones around the project files are in the MSBuild subdirectory you may get some use out of

C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas\1033\MSBuild\Microsoft.Build.Core.xsd

Good luck!

curtisk
Thanks, this gets it for VS 2005+, any idea on a VS 2003 project?
Mitchel Sellers
@Mitchel: I don't think VS2003 used the MSBUILD format, did it?
John Saunders
Hmmmm....I have to think if I can pull up an old revision of one of the apps to see if there is still a vs2003 project to refer to..I'll follow up after I take a look
curtisk
No luck on the vs 2003 schema, it seems to be a fairly straightforward format though after looking at one.
curtisk
@John - Nope, it uses devenv for compile. @curtisk thanks for trying, but your answer got the big piece that I needed.
Mitchel Sellers
A: 

I doubt there is a schema for this -- you'll probably need to peruse your project files or create some samples in various versions of VS for testing. The format is pretty straightforward for C# and VB.NET (but don't get me started on VC++ -- it gets really convoluted and changes with each version).

Kyle Alons
@Kyle: there are schemas. See the first two answers.
John Saunders
Interesting -- thanks. I don't think those existed in earlier versions (VC6, VS.NET, VS 2003), which is probably why I never noticed.
Kyle Alons