79706093

Date: 2025-07-18 11:22:15
Score: 3.5
Natty:
Report link

TL;DR: First off, remove binding redirects, then despair ahead.

Binding Redirects (remove them)

A common solution people recommend for this problem is to create a binding redirect.

Quite often, though, a binding redirect which already exists (and was added in the past) IS the cause of the problem, and removing the binding redirect is the solution. So check all your app.config and web.config files for suspicious binding redirects for the affected module, and try to remove them before you try to change them. If after removing all binding redirects you still get a similar error (often it's about a different version), then you may consider adding a binding redirect back where needed (and creating a new annoying problem for the poor sob who has to update the NuGet packages the next time).

Binding redirects are the "DLL hell" of .NET framework. Nobody I know knows what they are and how they work, there is hardly any understandable documentation for them online, and problems with binding redirects always hit you at the worst of times, when the last thing you want to do is to nerd out about some peculiar feature of your language and build system. Not even I am autistic enough for binding redirects to pique my interest. Even Github Copilot refuses to answer questions about binding redirects, it seems.

Gacutil (DON'T!)

Another common solution people always keep recommending is to perform some magical incantation that involves the gacutil command.

While this may "work", it is a manual intervention that makes some global change on your personal development system, but not in the sources or build files of your project. Will your built project now work on every target system it is meant to be deployed to? Will other developers on your team have to run the same command? And your customers, too? Who is going to tell them? And will you even remember you ran this command and what the exact command-line was that you copied from StackOverflow (or from some AI answer that scraped it from SO)?

This is how you run into situations where something "works for you" and your manager will respond with that worn out joke: "OK, then we ship your computer".

Running gacutil is almost NEVER the right solution unless you are a consumer and not a developer trying to get your own code to build and run (which is the target audience of this website). When you are looking at a gacutil command line on some Chinese language website you found with Google, then it's time to turn off your computer, call it a week and head out for drinks.

Reasons:
  • Blacklisted phrase (1): StackOverflow
  • RegEx Blacklisted phrase (2): even I am
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): get a similar error
  • Contains question mark (0.5):
  • High reputation (-1):
Posted by: Florian Winter