例如,我有一个具有以下结构的 .csproj 文件:
...
<ItemGroup>
<Compile Include="...">
<Link>...</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="..." Version="..." />
</ItemGroup>
... there may even be some other tags in between ItemGroups ...
<ItemGroup>
<ProjectReference Include="..." />
</ItemGroup>
<ItemGroup>
<Reference Include="...">
<HintPath>...</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="...">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
... There may be even more additional ItemGroups with other content ...
...
我可以将它们全部合并为一个,像这样吗?
...
<ItemGroup>
<PackageReference Include="..." Version="..." />
<ProjectReference Include="..." />
<Compile Include="...">
<Link>...</Link>
</Compile>
<Reference Include="...">
<HintPath>...</HintPath>
</Reference>
<None Update="...">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
...
我已经做到了,从我目前观察到的情况似乎没有问题,但是我不希望我或其他开发人员稍后遇到他们,不知道他们可能与此操作有关。