WPF isn't passing all item metadata to its temporary local type assembly project
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
WPF only includes two types of metadata in its temp project: Aliases and EmbedInteropTypes.
https://github.com/dotnet/wpf/blob/master/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/GenerateTemporaryTargetAssembly.cs#L653
```cs
for (int i = 0; i < pItemList.Length; i++)
{
// Create an element for the given sItemName
XmlElement nodeItem = xmlProjectDoc.CreateElement(sItemName, root.NamespaceURI);
// Create an Attribute "Include"
XmlAttribute attrInclude = xmlProjectDoc.CreateAttribute(INCLUDE_ATTR_NAME);
ITaskItem pItem = pItemList[i];
// Set the value for Include attribute.
attrInclude.Value = pItem.ItemSpec;
// Add the attribute to current item node.
nodeItem.SetAttributeNode(attrInclude);
string embedInteropTypesMetadata = pItem.GetMetadata(EMBEDINTEROPTYPES);
if (!String.IsNullOrEmpty(embedInteropTypesMetadata))
{
embedItem = xmlProjectDoc.CreateElement(EMBEDINTEROPTYPES, root.NamespaceURI);
embedItem.InnerText = embedInteropTypesMetadata;
nodeItem.AppendChild(embedItem);
}
string aliases = pItem.GetMetadata(ALIASES);
if (!String.IsNullOrEmpty(aliases))
{
embedItem = xmlProjectDoc.CreateElement(ALIASES, root.NamespaceURI);
embedItem.InnerText = aliases;
nodeItem.AppendChild(embedItem);
}
// Add current item node into the children list of ItemGroup
nodeItemGroup.AppendChild(nodeItem);
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.