These are functionally equivalent. With one exception, using attributes on the <PackageReference> element is a shortcut for having a nested elements by the same name. The exception is the Include attribute, which cannot be a nested element.
So, Visual Studio, MSBuild, NuGet, etc. will treat these the the same:
<PackageReference Include="Contoso.Utility.UsefulStuff" Version="3.6.0" /> <PackageReference Include="Contoso.Utility.UsefulStuff"> <Version>3.6.0</Version> </PackageReference> Same goes for the other attributes like "ExcludeAsset".
after using NuGet package manager (in VS), I ended up with quite different XML though.
The NuGet package manager in VS isn't honoring the original format of the document when it makes modifications to your <PackageReference>'s. It probably NuGet is getting the interprettedinterpreted result of the .csproj file, not the raw XML, so it doesn't know whether you were using attributes or nested elements.