Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference for msbuild itemgroup content

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

like image 380
NicolasR Avatar asked Dec 30 '25 15:12

NicolasR


1 Answers

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

like image 186
Dean Marcussen Avatar answered Jan 02 '26 00:01

Dean Marcussen