https://github.com/devlooped/packagereferencecleaner
Clean your PackageReferences with PrivateAssets=all into beautiful one-liners, automatically
https://github.com/devlooped/packagereferencecleaner
Last synced: about 1 year ago
JSON representation
Clean your PackageReferences with PrivateAssets=all into beautiful one-liners, automatically
- Host: GitHub
- URL: https://github.com/devlooped/packagereferencecleaner
- Owner: devlooped
- License: mit
- Created: 2023-03-25T18:56:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T00:18:20.000Z (over 1 year ago)
- Last Synced: 2025-03-25T03:34:06.656Z (over 1 year ago)
- Language: C#
- Size: 517 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license.txt
Awesome Lists containing this project
README
# PackageReference Cleaner
Cleans the following crazy NuGet package reference mess:
```xml
all
runtime; build; native; contentfiles; analyzers; buildtransitive
all
runtime; build; native; contentfiles; analyzers; buildtransitive
all
runtime; build; native; contentfiles; analyzers; buildtransitive
all
runtime; build; native; contentfiles; analyzers; buildtransitive
all
runtime; build; native; contentfiles; analyzers; buildtransitive
all
runtime; build; native; contentfiles; analyzers; buildtransitive
```
Into this perfectly clean and 100% equivalent beauty:
```xml
```
## How it works
A diagnostic analyzer inspects the MSBuild project file looking for
`` with `PrivateAssets=all` (via inner element or
attribute), removes all its child nodes and moves (if necessary) the
`PrivateAssets` child element to an attribute.
This is done automatically whenever the analyzer runs, and nothing
is saved unless a node was cleaned.
# Sponsors
[](https://github.com/clarius)
[](https://github.com/MelbourneDeveloper)
[](https://github.com/augustoproiete)
[](https://github.com/KirillOsenkov)
[](https://github.com/MFB-Technologies-Inc)
[](https://github.com/sandrock)
[](https://github.com/eeseewy)
[](https://github.com/agocke)
[](https://github.com/sponsors/devlooped)
[Learn more about GitHub Sponsors](https://github.com/sponsors)