Reference for msbuild itemgroup content - msbuild

I several times had trouble finding information about valid elements in csproj files (.NET Core). Especially ItemGroup with Content and Include/Exclude/Update/CopyToPublishDirectory attributes.
Also I am interested in "None Include=..." elements.
Is there any offical reference for all this?
At least I could only find a few SO posts.
Update
in the meantime I found this upgrade guide (project.json -> csproj) by Nate McMaster which contains a few examples for Content and None but is far from a reference.
https://learn.microsoft.com/en-us/dotnet/core/tools/project-json-to-csproj

I have also had difficulty finding good reference information about this
This list of well known item metadata properties may help
https://msdn.microsoft.com/en-us/library/ms164313.aspx
However for include / exclude attributes (as against properties)
try this msdn link
https://msdn.microsoft.com/en-us/library/ms171453.aspx
At a pinch I have often written a custom task which takes an itemgroup and iterates metadata - though it's worth noting the difference between metadata (such as the Identity property), and attributes such as include exclude, which are fixed, and explained in the second msdn link

Related

What does the "namespace='##other' processContents='lax'" mean?

I read WiX documentation.
Time of time in the WiX documentation I see the phrase "Any Attribute (namespace='##other' processContents='lax') Extensibility point in the WiX XML Schema. Schema extensions can register additional attributes at this point in the schema". For example i see it here.
I don't understand this phrase and in particular what is specified in the brackets. I will be grateful for clarification.
The referenced subphrase namespace='##other' processContents='lax' is XSD terminology; see questions on ##other and processContents for more details on what they directly mean.
In this context, this allows you to insert qualified (i.e. namespaced) attributes into a WiX element and still validate the resulting XML document. Most WiX elements allow both attributes and child elements of this nature. They are used, as the text suggests, to allow for extensions to WiX that process these attributes and elements as part of a build step. You can create your own extensions to automate or simplify specialized tasks that the WiX team doesn't implement in core.

Reference for expression syntax in CSPROJ files

Can somebody please point me to a reference for the syntax of the expression language used in csproj / vbproj files within Visual Studio ? I've been seeing usages like the following :
<FilesForPackagingFromProject Include="%(CustomFiles.Identity)">
... and I'm trying to understand the '.Identity' bit.
The Identity bit is one of many MSBuild Well-known Item Metadata. It is essentialy metadata of msbuild Items. You can use the metadata to Transform Item Types.
This question How do you include additional files using VS2010 web deployment packages? doesn't directly address your question but the most popular answer has loads of useful information and provides a clue as to what the % sign means.
<_CustomFiles Include="..\Extra Files\**\*" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
I think the _CustomFiles tag creates a link to an external file, then %(_CustomFiles.Identity) refers to an element within that external file.
UPDATE:
NO! This is not right. The % expression gives a scalar value. The _CustomFiles is an Item and the .Identity part of the syntax refers to well-known metadata as explained by Marcos in the accepted answer.

where is the reference for msbuild extensibility keywords?

I'm working with an msbuild file and I see things like %(copylocal) and #(intermediateassembly).
I know some of them can be found at http://msdn.microsoft.com/en-us/library/ms164313.aspx but is there a comprehensive list somewhere?
In general you can create your own properties (referenced with $) and items (referenced with #) with any metadata (referenced with %) you like. Take a look at this link and all related to her if you want to know more about main concepts of MSBuild: MSBuild Concepts

Stopping doxygen searching for (and assuming) non-existant variables in source code

Im using doxygen outside of its design, but well within its capability. I have a bunch of essentially text files, appended with some doxygen tags. I am successfully generating doxygen output. However, somehow doxygen occasionally discovers what it assumes to be a variable, and proceeds to document it using surrounding text, causing a lot of confusing documentation. I cant see any direct relationship between these anomalies, only that they're reproducing the same output on each run, and what I can see is at least some are next to a ';' or a '='.
I only want doxygen to document what I've manually tagged. I am hoping to remove any occurrence of these anomalies, however I cannot alter existing text. I can only add doxygen tags, or alter the configuration file. Any ideas?
Many thanks.
Because in my particular case, I do not need any automatically generated documentation, only that which I have tagged with doxygen tags, setting
EXCLUDE_SYMBOLS = *
removes any instance of doxygen "finding" and documenting variables. This however may remove any ability to find any class declarations, namespaces or functions, however this is acceptable for me.

Is AssemblyInfo.cpp necessary?

I want to remove AssemblyInfo.cpp, because of some metadata errors that sometimes come up.
Is AssemblyInfo.cpp useful for anything? Or can it be removed without any problem?
I've discovered one distinction for this file: it has to do with values reported under calls to Assembly.GetReferencedAssemblies. I was working on tracking version numbers of our binaries from our SVN repository by embedding the revision numbers into them. Initially I too was updating AssemblyInfo.cpp and found nothing reported in the file property details tab for the binary. It seemed this file did nothing for me in terms of updating those details, which was not the case with similar updates to a csproj's AssemblyInfo.cs. Why the difference right?
Now in one such csproj we happen to reference a vcxproj and that csproj dumps to a log the versions of all its referenced assemblies using the .NET Assembly.GetReferencedAssemblies method. What I discovered was that the number that was being reported in that log was not the vcxproj's version as given by the VS_VERSIONINFO resource I added (which does get the version details into the file properties details tab). Instead the number reported was actually matching that defined in the AssemblyInfo.cpp.
So for vcxproj files it looks like VS_VERSIONINFO is capable of updating the contents you find under the file properties details tab but AssemblyInfo.cpp is capable of exposing the version to GetReferencedAssemblies. In C# these two areas of reporting seem to be unified. Maybe there's a way to direct AssemblyInfo.cpp to propagate into the file details in some fashion, but what I'm going to wind up doing is duplicating the build info to both locations in a prebuild step. Maybe someone can find a better approach.
So far I never had the AssemblyInfo.cpp in my managed c++ dlls, so I don't think it is necessary.
(I just added the file to have version information for my c++ dlls).
Why not just fix the errors? On that note, what errors are you getting?
This file provides information such as a version number which is definitely needed in order to use the assembly you have built.