An open API service indexing awesome lists of open source software.

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

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

[![Clarius Org](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/clarius.png "Clarius Org")](https://github.com/clarius)
[![Christian Findlay](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/MelbourneDeveloper.png "Christian Findlay")](https://github.com/MelbourneDeveloper)
[![C. Augusto Proiete](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/augustoproiete.png "C. Augusto Proiete")](https://github.com/augustoproiete)
[![Kirill Osenkov](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/KirillOsenkov.png "Kirill Osenkov")](https://github.com/KirillOsenkov)
[![MFB Technologies, Inc.](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/MFB-Technologies-Inc.png "MFB Technologies, Inc.")](https://github.com/MFB-Technologies-Inc)
[![SandRock](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/sandrock.png "SandRock")](https://github.com/sandrock)
[![Eric C](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/eeseewy.png "Eric C")](https://github.com/eeseewy)
[![Andy Gocke](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/agocke.png "Andy Gocke")](https://github.com/agocke)

[![Sponsor this project](https://raw.githubusercontent.com/devlooped/sponsors/main/sponsor.png "Sponsor this project")](https://github.com/sponsors/devlooped)
 

[Learn more about GitHub Sponsors](https://github.com/sponsors)