-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Labels
Functionality:AddPackageIssues with dotnet package addIssues with dotnet package addProduct:dotnet.exeType:Bug
Description
NuGet Product Used
dotnet.exe
Product Version
.NET SDK 9.0.204
Worked before?
No
Impact
It bothers me. A fix would be nice
Repro Steps & Context
Create a .csproj with the following contents:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /><!-- some comment -->
</ItemGroup>
</Project>Run the following command:
dotnet add package Serilog --version 4.3.0Result:
The trailing comment on the Newtonsoft.Json line is moved to the newly added package.
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Serilog" Version="4.3.0" /><!-- some comment -->
</ItemGroup>Expected:
The trailing comment on the Newtonsoft.Json line should have stayed put.
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /><!-- some comment -->
<PackageReference Include="Serilog" Version="4.3.0" />
</ItemGroup>Verbose Logs
Metadata
Metadata
Assignees
Labels
Functionality:AddPackageIssues with dotnet package addIssues with dotnet package addProduct:dotnet.exeType:Bug