Breaking Free from Dependency Hell: The Story Behind AutoAssemblyResolver

Benjamin Buchfink
2 min readMar 6, 2025

--

Unraveling the Journey of a Developer’s Struggle and Triumph

Every developer has faced it — the dreaded dependency hell. For me, it became a daily battle while working on a large desktop solution teeming with modules, each dragging along its own dependencies. This chaotic tangle often resulted in different versions of the same dependency, forcing me to navigate a maze of assembly version redirects.

The Turning Point

As I juggled between resolving these dependencies manually and maintaining my sanity, the .NET compiler did its best to help by creating assembly version redirects. But there was a catch — the runtime could only resolve these dependencies if the main process was a .NET process. In cases where modules were accessed via COM, the issue remained unresolved.

I had reached my breaking point. Manually adding an AssemblyResolve resolver to each module wasn't just impractical—it was an invitation to an endless cycle of frustration. But in that moment of exasperation, an idea was born—why not create a solution that would automatically resolve these assemblies for me?

The Birth of AutoAssemblyResolver

That’s when I rolled up my sleeves and got to work on AutoAssemblyResolver. This NuGet package was designed to be the silver bullet for developers stuck in similar predicaments. AutoAssemblyResolver includes a source generator that effortlessly generates an AssemblyResolve event for you. Depending on your .NET version, it either leverages the ModuleInitializer attribute or uses a tool called Injector to create the module initializer during each build.

With AutoAssemblyResolver, you can finally breathe easy. Your project will automatically load any assembly by name, regardless of the version. No more manual resolvers, no more dependency version hell.

A Word of Caution

While AutoAssemblyResolver simplifies dependency management, it’s important to remain vigilant about potential security risks. This package will load DLL files in the program’s directory if any code attempts to access them. Depending on your use case, this could pose a significant security issue.

Acknowledgements

AutoAssemblyResolver builds on the foundational work of Creating a module initializer in .NET and takes it just a little bit further.

If AutoAssemblyResolver has made your development journey smoother, consider supporting the project by donating via PayPal or becoming a sponsor on GitHub.

Happy coding, and may you forever be free from dependency hell!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Benjamin Buchfink
Benjamin Buchfink

Written by Benjamin Buchfink

I'm a senior dev at a small German company. Software engineering takes a big chunk of my life. I love to learn new stuff and to share it with others.

No responses yet

Write a response