Skip to content

Add generated projects to solution does not work for .slnx. (D396686C-DE0E-4DE6-906D-291CD29FC5DE) #8906

Open
@rynowak

Description

@rynowak

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:

  1. Create a .NET new template that creates a project.
  2. 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
    },
  1. 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+1c2026462

Runtime 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions