views:

596

answers:

4

I looked on MSDN, couldn't find it.
I found an XML Schema for the .vcproj file, which is nice.
But what I really want is an explanation for each of the elements in the vcproj file, a reference.

The immediate question in front of me is, what is the significance of the UniqueIdentifier attribute in the element VisualStudioProject/Files/Filter ? Is the UUID for source files the same across projects? Or is it unique globally?

<VisualStudioProject>
  ...
  <Files>
      <Filter
        Name="Source Files"
        Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
        >
        <File ... />
          ... 
      </Filter>
      <Filter
        Name="Header Files"
        Filter="h;hpp;hxx;hm;inl;inc;xsd"
        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
        >
        <File ... />
          ... 
      </Filter>
      <Filter
        Name="Resource Files"
        Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
        UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
        >
        <File ... />
          ... 
      </Filter>
  </Files>
  <Globals>
  </Globals>
</VisualStudioProject>

But after I answer that one question I am sure I will have 10000 more. So I'd like a reference, that allows me to edit the .vcproj directly.

Can anyone suggest?

EDIT: Even if MS does not document it, each element does have a meaning. Does anyone know of a list or a summary?

+1  A: 

I suspect Microsoft is not intending to make the format a documented one. Microsoft has stated in the past that documented features and formats require in some cases an order of magnitude more work.

If the format is not documented, it's because Microsoft wants it that way. Any documentation will be through analysis and reverse-engineering.

Charlie Salts
I can believe that MS did not document the format. But it's XML, it's readable. Has anyone, anywhere, done the analysis and reverse engineering?
Cheeso
The XML node names pretty much correspond to options in the config manager / properties pages for your project. It shouldn't be rocket surgery to figure it out.
jeffamaphone
+1  A: 

I don't know what you need this for, so this may or may not be relevant, but Visual Studio 2010 is going to ditch the .vcproj format. ;)

They're switching to .vcxproj, which is based on MSBuild. (And as such, is also going to be fully documented)

So it may be easier to target that, at least in the long run.

As for the GUID's, I believe each of them just have to be unique. I don't think there's any relationship between them (two elements should never have the same GUID).

Microsoft just likes to give everything its own GUID. You never know when you're gonna need it! ;)

jalf
I know the project file will change, but.. I don't have the budget for VS2010. After looking at it further, "Source Files" (the collection) has a GUID, "Header Files" has a GUID, and "Resource Files" has a GUID, and these appear to be the same GUIDs across projects.
Cheeso
A: 

I think I remember an issue with a really old version of CMake to do with UniqueIdentifier, that they weren't properly unique. If I am correct the issue was fixed, and uniqueIdentifier should be a GUID.

Sorry I cannot be more help. I moved over to cmake and now I don't have to mess with vcproj files, they are generated for me.

You can probably find more information on the the CMake site, as they have a generator for the vc project files they must have done all the reverse engineering already.

iain
Also QT has a generator(qmake) for vc project files from .pro files which are defined by QT.
metdos
+1  A: 

All the elements in the .vcproj are documented, sort of, i.e. the DevStudio documentation for the VS Automation interfaces describe the project objects/properties, and the project objects/properties directly map to the xml elements/attributes.

Andy J Buchanan
This is worth a look, thanks.
Cheeso