Hello every one
Can we change the settings of a dll file after deployment
if we can not , any alternative suggestions ?

thx

Dani AI

Generated

— short answer: you generally cannot and should not try to change a DLL's compiled code or embedded metadata after deployment to "tweak settings." A DLL contains compiled IL, embedded resources and assembly metadata (version, strong name, attributes) and any hard-coded values; changing those reliably requires rebuilding or binary editing.

If what you mean by "settings" is configuration the DLL reads at runtime, move those out of the binary. Common patterns that let behavior be changed without touching the DLL:

  • External config (app.config/web.config or appsettings.json + IConfiguration).
  • Environment variables, registry, or a database.
  • A small wrapper or plugin loader that reads config and instantiates the implementation from the DLL.
  • Dependency injection so concrete behavior is selected at startup.

Example (reading an AppSetting in .NET Framework):

var value = System.Configuration.ConfigurationManager.AppSettings["MySetting"];

About the points raised in thread: mentioned Type Forwarding — that mechanism is used to move types between assemblies, not to change runtime settings. See Microsoft docs on type forwarding for details: Type forwarding. For redirecting to a different assembly/version without changing callers, look at assembly binding redirects/publisher policy: Redirect assembly versions.

If you absolutely must change a deployed DLL binary, tools like dnSpy or Mono.Cecil can patch IL, but this breaks strong-name signatures (you must re-sign) and is risky for stability and security — see strong-name guidance: Strong-named assemblies.

Recommended plan: if you control source, externalize settings and redeploy. If you do not, prefer app-config or a wrapper; only consider binary edits as a last resort and with full testing and re-signing where needed.

Recommended Answers

All 2 Replies

What settings does a Dll file have exactly?

There is a new feature Called Type Forwarding from onwards .NET 2.0. I also do not know much details about that Attribute

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.