A tool that scans your project files and converts
<PackageReference Include="MyPackage">
<Version>1.2.3.4</Version>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
to
<PackageReference Include="MyPackage" Version="1.2.3.4" PrivateAssets="all" />
- All elements are converted to attributes
IncludeAssets
is removed ifPrivateAssets=All
To install the tool, run
dotnet tool install -g PackageReferenceNormalizer
Run PackageReferenceNormalizer c:\Dev\MyProject\*.csproj
This will scan all *.csproj
files in c:\Dev\MyProject
and all sub-folders
Run PackageReferenceNormalizer *.csproj
This will scan all *.csproj
files in the current directory and all sub-folders