Skip to content

Add MSBuildProjectDirectory fallback to ProjectDir resolution #5146

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

Merged
merged 1 commit into from
Apr 20, 2025

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Apr 20, 2025

fixes #5127

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

@Copilot Copilot AI left a comment

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
3 checks passed
@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
1 participant