Fixing „A dynamic link library (DLL) initialization routine failed.“ error on Windows 8

Die einfachste Art, Ihre professionelle Website selbst zu erstellen

Just fixed an issue with our Zeta Producer 11 that occurs only on the brand new Windows 8. The German error message was:

Die Datei oder Assembly „ZetaHtmlTidy.dll“ oder eine Abhängigkeit davon wurde nicht gefunden. Eine DLL-Initialisierungsroutine ist fehlgeschlagen. (Ausnahme von HRESULT: 0x8007045A)

Translated to English it was:

System.IO.FileLoadException ‚A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)‘

The DLL in concern was a mixed Managed/Unmanaged C++ assembly that wrapped the popular HTML Tidy C sources into a .NET-usable assembly.

So my first idea was that some CRT DLLs were missing:

  • msvcm90.dll
  • msvcp90.dll
  • msvcr90.dll
  • Microsoft.VC90.CRT.manifest

But all were present, even the well-known Dependency Walker/Viewer did not help any further.

Since version 10 of our application worked and version 11 did not work and brought the above error, I was clueless. The main difference was:

  • Version 10 was installed into „C:\Program Files (x86)\Zeta Producer 10“.
  • Version 11 was installed into „C:\Users\YourName\AppData\Local\Zeta Producer 11″ (to bypass administrative setup permissions).

When I moved Version 10 also below the „C:\Users\…“ folder, the error also occurred!

So the cause was not a missing assembly but some kind of (weird?) policy thing.

Some further digging/googling finally lead to the solution on Stack Overflow. The solution was to add some more App.config settings.

My previous, non-working App.config file contained:

My new, working App.config file was:

So it seems that setting „useLegacyV2RuntimeActivationPolicy“ to „true“ finally switched something to allow for loading mixed-mode DLLs from local folders. Doh!

Die einfachste Art, Ihre professionelle Website selbst zu erstellen

Ankommende Suchanfragen:

  • HRESULT: 0x8007045A
  • Exception from HRESULT: 0x8007045A
  • eine dll-initialisierungsroutine ist fehlgeschlagen
  • hresult 0x8007045A
  • 0x8007045a
  • 0x8007045a win7 dll initialization routine failed
  • a dynamic link library (dll) initialization routine failed
  • A dynamic link library initialization routine failed
  • dynamic dll
  • dynamic link ibrary dll initialization fail
  • dynamic link library initialization routine failed
  • error 0x8007045a
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1833 Do1zVGak6maEhVjRvmxhTs1eE5EDX6lkeYwahpNeHXPDJw3kkH_07tczCzmdg1dt 15344446c1668bf09265d513e5559ece8c3119d3&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme
  • iis System IO FileLoadException: Eine DLL-Initialisierungsroutine ist fehlgeschlagen (Ausnahme von HRESULT: 0x8007045A)
  • LN2U

3 Gedanken zu „Fixing „A dynamic link library (DLL) initialization routine failed.“ error on Windows 8

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.