Skip to content

Refactor .NET project file parsing#335

Merged
runesoerensen merged 38 commits intomainfrom
refactor-project-parsing
Oct 30, 2025
Merged

Refactor .NET project file parsing#335
runesoerensen merged 38 commits intomainfrom
refactor-project-parsing

Conversation

@runesoerensen
Copy link
Copy Markdown
Contributor

@runesoerensen runesoerensen commented Oct 29, 2025

This PR refactors the .NET project file parsing logic to use quick-xml's deserialization feature instead of manual XML tree traversal with roxmltree. This is similar to the approach used in the recently added SLNX parsing logic, and now better alligns with .NET project file semantics as well MSBuild behavior:

  • Eliminated the roxmltree dependency in favor of quick-xml deserialization.
  • Instead of traversing XML nodes manually, adding structs (ProjectXml, PropertyGroup, SdkElement) with serde derives to automatically parse project files.
  • Replaced the imperative parse_metadata function that walked the XML tree with declarative property extraction from deserialized structs.
  • The new implementation correctly handles MSBuild's "last wins" behavior for properties across multiple <PropertyGroup> elements, particularly for AssemblyName where blank/whitespace values trigger fallback to the filename.

The goal is to make the code cleaner and more maintainable in preparation for some planned upcoming changes to the project.rs changes.

GUS-W-20073970

@runesoerensen runesoerensen marked this pull request as ready for review October 29, 2025 17:10
@runesoerensen runesoerensen requested a review from a team as a code owner October 29, 2025 17:10
@runesoerensen runesoerensen merged commit 9a2ebca into main Oct 30, 2025
24 of 31 checks passed
@runesoerensen runesoerensen deleted the refactor-project-parsing branch October 30, 2025 12:21
heroku-linguist bot added a commit that referenced this pull request Nov 10, 2025
## heroku/dotnet

### Added

- Support for .NET 10 file-based apps. ([#336](#336))

### Changed

- Refactored .NET project file parsing to allign with MSBuild behavior and project file semantics. ([#335](#335))
heroku-linguist bot added a commit that referenced this pull request Nov 11, 2025
## heroku/dotnet

### Added

- Support for .NET 10 file-based apps. ([#336](#336))

### Changed

- Refactored .NET project file parsing to allign with MSBuild behavior and project file semantics. ([#335](#335))
heroku-linguist bot added a commit that referenced this pull request Nov 11, 2025
## heroku/dotnet

### Added

- Support for .NET 10 file-based apps. ([#336](#336))

### Changed

- Refactored .NET project file parsing to allign with MSBuild behavior and project file semantics. ([#335](#335))

Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
heroku-linguist bot added a commit to heroku/cnb-builder-images that referenced this pull request Nov 11, 2025
## heroku/dotnet

### Added

- Support for .NET 10 file-based apps. ([#336](heroku/buildpacks-dotnet#336))

### Changed

- Refactored .NET project file parsing to allign with MSBuild behavior and project file semantics. ([#335](heroku/buildpacks-dotnet#335))
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