You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
I was trying to run
dotnet sln add XXXbut 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.