we are using some third-party library that have some dependencies that must be referenced from the projects.
So each “csproj” file will have a bunch of “Reference” elements that will always be identical.
Is there a way to group this set of elements in one standard element that could be used accross all the csproj files ?
E.g :
<ABunchOfReferences>
<Reference Include="Reference1" />
<Reference Include="Reference2" />
<Reference Include="Reference3" />
</ABunchOfReferences>
...
<ItemGroup>
<ABunchOfReferences/>
<Reference Include="System" />
<Reference Include="System.Core" />
...
</ItemGroup>
“ABunchOfReferences” would be a kind of macro globally defined and included by all the csprojs that when used would be expanded as 3 “Reference” elements.
Thanks in advance for any idea.
You can set up your references in an import file, then selectively include them in the main file,
In References.props
…then in the individual project file