You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How can I parse PackageReference from many ItemGroup? #7522
I'm using Microsoft.Build on version 17.1.0 as a library inside a .NET 6 simple application. My main goal is to have the attributes of PackageReference (Include and Version) starting at ProjectRootElement.Open(path), but when I loop thou the ItemGroups, I'm not able to find any other attribute than Version:
Are you wanting to do this as XML, or as MSBuild objects? The latter is preferred, but requires you to think more about the actual item type. Specifically, the Include is expressed in XML as an attribute, but becomes something more fundamental to the MSBuild type--it's not metadata because it's special and it's available in ProjectItemElement.Include. Exclude and Remove are also special.
What specific problem are you trying to solve? There may be a better way to go about it.
Activity
rainersigwald commentedon Apr 6, 2022
Are you wanting to do this as XML, or as MSBuild objects? The latter is preferred, but requires you to think more about the actual item type. Specifically, the
Includeis expressed in XML as an attribute, but becomes something more fundamental to the MSBuild type--it's not metadata because it's special and it's available inProjectItemElement.Include.ExcludeandRemoveare also special.What specific problem are you trying to solve? There may be a better way to go about it.