Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Project configuration mappings are deleted when its GUID collides with another project's derived default ID #154

Copy link
Copy link

Description

@parched
Issue body actions

I was trying to run dotnet sln add XXX but it kept removing some unrelated project's configuration mappings.
Eventually, I realized it was a project that had been renamed but kept the same GUID, and another project had been added afterwards with the same original name. Claude told me this was right repo to file this, please transfer if not.

mkdir /tmp/repro && cd /tmp/repro
dotnet new sln -n repro --format sln
dotnet new classlib -o A
dotnet new classlib -o B
dotnet new classlib -o C
dotnet sln repro.sln add A B

# Give A the ID that the library deterministically derives for B's path:
#   {A0D7AA22-6627-6F78-C192-AD4CA0D6A2C6} == SHA256("B/B.csproj")[0..16]
# (I guess this was what VS did when adding the project to the sln, dotnet sln add seems to use a random GUID.)
OLD=$(grep '= "A",' repro.sln | grep -oP '(?<=csproj", "\{)[0-9A-F-]+')
sed -i "s/$OLD/A0D7AA22-6627-6F78-C192-AD4CA0D6A2C6/g" repro.sln

grep -c A0D7AA22 repro.sln    # 13  (1 project line + 12 config lines)
dotnet sln repro.sln add C    # exit 0, no warning
grep -c A0D7AA22 repro.sln    # 1   <-- A's 12 config lines silently deleted
Reactions are currently unavailable

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.