Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

msbuild - tag propertygroup has attribute Label but not documented

I need to manually modify my .vcxproj and I'm trying to understand the MSbuild schema using the documentation.

In my existing .vcxproj, I have the tag <PropertyGroup Label="Globals"> but in the documentation there is no mention of the Label attribute.

This is for an existing Visual Studio C++ project and there's no error when I launch it.

What does the Label attribute do?

like image 954
Bob Avatar asked Sep 25 '17 16:09

Bob


People also ask

What is ItemGroup in MSBuild?

In addition to the generic Item element, ItemGroup allows child elements that represent types of items, such as Reference , ProjectReference , Compile , and others as listed at Common MSBuild project items.

Where is the Vcxproj file?

vcxproj file by using any text or XML editor. You can view it in Visual Studio by right-clicking on the project in Solution Explorer, choosing Unload project and then choosing Edit Foo.

What is MSBuildProjectExtensionsPath?

The default value of MSBuildProjectExtensionsPath is $(BaseIntermediateOutputPath) , obj/ . NuGet uses this mechanism to refer to build logic delivered with packages; that is, at restore time, it creates {project}. nuget.


1 Answers

It is nowhere fully documented; the Target element documentation mentions it, but it has just

Optional attribute.

An identifier that can identify or order system and user elements.

A quick glance at the source code also reveals it is not actively used by the build system itself: it's just there, you can assign values to it and get them back, that's it. As such it can serve as a means of adding a description to the xml (instead of using a comment). This description can also be retrieved programmatically by the build system. Which is the only use I have actually seen by a tool, namely Visual Studio: as you figured it generates project files which contains some labels. VS uses these to determine where to find/insert code produced by it's user interface. Good example is the PropertySheets label: it's just an ImportGroup, you can have an arbitrary amount of those, but only the ImportGroup with the label PropertySheets will be displayed and modified by the Property Manager in VS. Likewise for the ProjectConfigurations ItemGroup, the Globals PropertyGroup, the Configuration Items etc.

like image 150
stijn Avatar answered Oct 13 '22 11:10

stijn