Skip to content

Don't report error reading invalid project type guid in .sln files.#104

Merged
richardstanton merged 1 commit intomainfrom
users/richsta/invalidprojecttype
Feb 28, 2025
Merged

Don't report error reading invalid project type guid in .sln files.#104
richardstanton merged 1 commit intomainfrom
users/richsta/invalidprojecttype

Conversation

@richardstanton
Copy link
Member

This was a behavior change between previous MSBuild and VS behavior. This serializer should not report an error if the project type is not a guid.

if (!Guid.TryParse(projectType.ToString(), out Guid projectTypeId))
{
projectTypeId = Guid.Empty;
this.tarnished = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

what exactly does marking it as tarnished do. Is there other functionality that is hidden behind the tarnished flag or is it mainly for logging?

Copy link
Member Author

Choose a reason for hiding this comment

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

It indicates that a property was missing and when loaded by a designer like VS it marks the file as modified, so it gets resaved. The sln parser is very forgiving of reading with different errors. We don't rely on this when parsing slnx as the parser is much stricter.

@richardstanton richardstanton merged commit d24f6fe into main Feb 28, 2025
2 checks passed
@richardstanton richardstanton deleted the users/richsta/invalidprojecttype branch February 28, 2025 22:43
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.

2 participants