Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting ProjectMetadataElement.Name #10673

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dfederm
Copy link
Contributor

@dfederm dfederm commented Sep 17, 2024

Fixes #10671

Currently the ProjectMetadataElement.Name setter updates the XmlNode for ProjectMetadataElement, but when the metadata is expressed as an attribute it does not update the attribute on the parent node.

This change does the bookeeping for the parent node.

One interesting tidbit is how even when expressed as an attribute, ProjectMetadataElement still uses an (unparented) XmlElementWithLocation to represent it.

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

/// <param name="oldName">The old name for the child element</param>
internal void UpdateElementName(ProjectElement child, string oldName)
{
ErrorUtilities.VerifyThrow(Link == null, "External project");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an error message that would be understandable to anyone reviewing log of crashing msbuild.
(This is inspired by still painful memory of troubleshooting sudden msbuild crashes with error message being "must be valid")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Setting ProjectMetadataElement.Name has weird behavior
2 participants