Description
Product
dotnet CLI (dotnet new)
Describe The Bug
The "add project to solution" post-action seems to ignore .slnx
files.
I have a template that was working before we migrated. Now it fails with:
Processing post-creation actions...
Unable to determine which solution file to add the reference to.
Post action failed.
Manual instructions: Add generated projects to solution.
To Reproduce
Steps:
- Create a .NET new template that creates a project.
- Use the following post-action:
"postActions": [
{
"description": "Add the project to the solution.",
"manualInstructions": [
{
"text": "Add generated projects to solution."
}
],
"actionId": "D396686C-DE0E-4DE6-906D-291CD29FC5DE",
"continueOnError": false
},
- Run this in a directory with an existing
.slnx
file (and no.sln
file).
dotnet Info
output
dotnet --info .NET SDK: Version: 9.0.201 Commit: 071aaccdc2 Workload version: 9.0.200-manifests.21502d11 MSBuild version: 17.13.13+1c2026462Runtime Environment:
OS Name: Mac OS X
OS Version: 15.4
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.201/
.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.3
Architecture: arm64
Commit: 831d23e561
.NET SDKs installed:
9.0.102 [/usr/local/share/dotnet/sdk]
9.0.200 [/usr/local/share/dotnet/sdk]
9.0.201 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
/Users/ryan/github.com/infinity-microsoft/picasso/global.json
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Visual Studio Version
No response
Additional context
No response