Skip to content

Add MSBuildProjectDirectory fallback to ProjectDir resolution - #5146

Merged
lahma merged 1 commit into
RicoSuter:masterfrom
lahma:project-dir-discovery-fallback
Apr 20, 2025
Merged

lahma merged 1 commit into
RicoSuter:masterfrom
lahma:project-dir-discovery-fallback

Conversation

@lahma

@lahma lahma commented Apr 20, 2025

Copy link
Copy Markdown
Collaborator

fixes #5127

@lahma
lahma requested a review from Copilot April 20, 2025 08:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request addresses issue #5127 by adding a fallback mechanism to resolve the ProjectDir property using the MSBuildProjectDirectory. Key changes include:

  • Adding a fallback call to ReadUsingMsBuildTargets if the primary metadata read does not yield a valid ProjectDir.
  • Including "MSBuildProjectDirectory" in the requested metadata properties.
  • Assigning the ProjectDir from MSBuildProjectDirectory when needed.
Files not reviewed (1)
  • Directory.Build.props: Language not supported
Comments suppressed due to low confidence (1)

src/NSwag.Commands/Commands/Generation/AspNetCore/ProjectMetadata.cs:233

  • [nitpick] Consider defining 'MSBuildProjectDirectory' as a named constant for better consistency with other metadata key definitions.
"MSBuildProjectDirectory",

@lahma
lahma merged commit 797ee5c into RicoSuter:master Apr 20, 2025
@lahma
lahma deleted the project-dir-discovery-fallback branch April 20, 2025 08:09
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.

.Net 9.0 NSwagExe_Net90 failing to generate C# client

2 participants