8000 Dotnet new "Add project to solution" postAction can not find slnx files · Issue #48878 · dotnet/sdk · GitHub
[go: up one dir, main page]

Skip to content

Dotnet new "Add project to solution" postAction can not find slnx files #48878

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

Open
nobowned opened this issue May 8, 2025 · 0 comments
Open
Labels
Area-dotnet new the item is related to dotnet new command untriaged Request triage from a team member

Comments

@nobowned
Copy link
nobowned commented May 8, 2025

Describe the bug

Running "dotnet new" with a template that uses the "add project to solution" postAction fails to find slnx solution files.

To Reproduce

  1. Clone https://github.com/nobowned/dotnet-new-slnx-repro
  2. Go into cloned repo
  3. Run "dotnet new --install ."
  4. Create a new folder and enter it
  5. Run "dotnet new custom-dotnet-template" within new folder
  6. Notice error message:
The template "Custom .NET Template" was created successfully.

Processing post-creation actions...
Unable to determine which solution file to add the reference to.
Post action failed.
Manual instructions: Add project to solution manually.

I believe this is the troublesome code:

https://github.com/dotnet/sdk/blob/v9.0.203/src/Cli/dotnet/commands/dotnet-new/PostActions/DotnetSlnPostActionProcessor.cs#L30-L31

"FileFindHelpers.FindFilesAtOrAbovePath" doesn't return null. It returns an empty list if nothing is found.

@dotnet-policy-service dotnet-policy-service bot added the untriaged Request triage from a team member label May 8, 2025
@github-actions github-actions bot added the Area-dotnet new the item is related to dotnet new command label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-dotnet new the item is related to dotnet new command untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant
0