How fix Transitive Dependencies and Nuget's hell in your .Net project
Victor Buzin
Modern Workplace Architect | Software Development Manager | Team Leader
Yesterday, when I was working on a large project, the so-called transitive dependencies and accidentally stumbled upon a very interesting tool called the #Snitch. It's a briefly post about this but for me Snitch really helpfully.
Do you remember DLL or Nuget Hells??NuGet Packages in fresh projects it's Hell x 2 (Deprecated packages, Visions, Obsolete )
But what does this have to do with it and what is a Snitch?
Let's start.
??Transitive Dependencies ??
What is transitive? A Transitive Dependency is a dependency induced by the dependencies of the direct references of that project.
Theory: A transitive dependency?occurs when one non-prime attribute is dependent on another non-prime attribute. If a table schema T ( X ˉ , Y , Z ) contains a dependency f : Y → Z , where Y and Z are non-prime attributes, we say it contains a transitive dependency from X to Z .
Transitive Dependencies it's a problem?
Yep it's a hell because at this moment you have min 20-30 packages in your project on a starting point and then you have >50 if you working on a real production project.
??How to use a Snitch and what is it?
Snitch: A tool that help you find transitive package references that can be removed.
The best part is that?Snitch is simple and frictionless.
To install, it's a simple dotnet tool. Once you have .NET CLI installed, just run:
领英推荐
dotnet tool install -g snitch
Then, using the terminal, navigate to the folder of a .NET solution and run:
snitch
You will see result like this:
I'm really like console apps and tools with elegant ux. This console based on Spectre.Console (Link on a git down below)
?? Finally??
Go check it out (after you finish reading) and give it a start on GitHub. Please put an to the project, it's always nice to the creator ?.
Project Url: snitch on a github
Spectre.Console: spectreconsole on a github