Windows error 0x8007045A, -2147023782

Detailed Error Information

DLL_INIT_FAILED[1]

MessageA dynamic link library (DLL) initialization routine failed.
Declared inwinerror.h

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode7 (0x007)
NameFACILITY_WIN32[2][1]
DescriptionThis region is reserved to map undecorated error codes into HRESULTs.[2][1]
Error Code1114 (0x045a)

This is a Win32 error which has been mapped into an HRESULT. More information may be available in error 0x0000045a.

Questions

20votes
11answers

Could not load file or assembly 'CefSharp.dll' or one of its dependencies

I'm trying to use CefSharp to load my web app into winfoms. I've added 2 dll files: CefSharp.dll and CefSharp.WinForms into references and add 2 dll files icudt.dll and libcef.dll into my project through add existing items. enter image description here [https://i.stack.imgur.com/TnQAj.png] and this is the code from the form [...] read more
c#
winforms
cefsharp
8votes
2answers

Calling C++ DLL from C++ works, but not from C#

I have a DLL called tccdvc.dll which is part of an SDK available here: http://www.commell.com.tw/Download/Driver/Industrial%20Peripheral/Driver/MPX-885/MPX-885%20SDK%20(1.2)/SetupCOMMELL%20MPX-885_20100627.rar The DLL was written in C++ and examining the DLL shows it was linked with linker version 6.0, so I assume it was written with VC++ 6.0. The DLL does not come with source code, [...] read more
c#
c++
dll
loadlibrary
7votes
4answers

Error creating Web proxy

I have a CLR enabled .NET app that accesses a webservice and writes an xml file to a webserver for a SQLServer SSIS package to digest. Everything works fine on the development servers, but the production server returns the following error: > Error creating the Web Proxy specified in the [...] read more
.net
clr
webproxy
7votes
1answer

64 bit managed assembly with unmanaged dependencies not loading in IIS / ASP.NET MVC 4

I have an almost empty ASP.NET MVC4 project referencing a 64 bit managed assembly, which has a set of unmanaged dependencies. The managed assembly is referenced the normal way through references. The unmanaged dependencies are copied to the bin folder on a post build event - and are present when [...] read more
asp.net
64-bit
unmanaged
iis-8
3votes
4answers

What does ERROR_DLL_INIT_FAILED mean?

I'm seeing the following exception in my managed (C#) app calling an unmanaged assembly: > Caught:System.IO.FileLoadException 'A dynamic link library (DLL) > initialization routine failed. (Exception from HRESULT: 0x8007045A)' What does this HRESULT mean, and where should I start in diagnosing this? read more
exception
hresult
3votes
3answers

Unable to load dll file - exception 0x8007007E

I'm working with National Instruments Measurement Studio in C#, and I've come across a bit of a problem in deploying my application to a particular computer (running Windows 7). I've tried asking on the National Instruments forums, but haven't got any solutions yet - could anyone here give me some [...] read more
c#
.net
dll
3votes
1answer

Side-by-Side errors in Managed C++ wrapper DLL in VS2005+

I have a native C++ library with a .NET wrapper, all built in Visual Studio 2003 and 2005. We recently ported the .NET wrapper library to VS2005 and it doesn't work. The .NET wrapper library is mixed-mode, with native C++ and Managed extensions classes, and a bit of native assembly [...] read more
.net
visual-studio-2005
winsxs
3votes
3answers

Using LuaInterface - ERROR_DLL_INIT_FAILED

I've been trying to integrate Lua into my managed code, using LuaInterface. I'm using the lua51.dll that came with the assembly I downloaded, but when I try to create a new Lua object, the constructor fails with ERROR_DLL_INIT_FAILED, or HRESULT 0x8007045A. I checked that I'm building as x86. What else [...] read more
c#
dll
lua
2votes
2answers

Psexec issue when running an application on a Windows Server 2008 R2 machine from a 2003 R2 machine

I am trying to run an application on a Windows Server 2008 R2 machine from a Windows Server 2003 R2 machine using a batch file with the following line of code in a batch file: psexec \\nightmachine -u DOMAIN\User -p Password -i "C:\FilePath\Application.exe" argument1 argument2 The application fails to run [...] read more
batch-file
psexec
2votes
0answers

Azure Function: load unmanaged c++ dll from c#, Error: "Unable to load DLL or one of its dependencies"

Azure Function use unmanaged DLLs, I got the error as follows: "Unable to load DLL 'aa.dll' or one of its dependencies: A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) " with the solution proposed by Link, I have successfully copied all my unmanaged DLLs to the [...] read more
azure-functions
dllimport
2votes
1answer

x86 console application doesn't run on 64bit machines except in debugger

In order to get a better hold on my question NUnit: Could not load file or assembly 'some.dll' or one of its dependencies. The specified module could not be found I tried to reduce complexity by getting rid of NUnit. Now I wrote a plain console application (C#) which interacts [...] read more
c#
32bit-64bit
2votes
2answers

Use DirectWrite from a C# XAML Metro-style app

Could you provide some guidelines for how to use DirectWrite from a C# XAML-based Metro-style app. I want to create a XAML-based UI, but I also want to write custom text onto the screen effectively. My guess is that I can create a WinRT component in C++ which access DirectWrite [...] read more
c#
c++
xaml
windows-runtime
directx
2votes
2answers

WPF - How to run WPF solution in VS2010 SP1

I am following the tutorial from the book "Pro C# 2010 and the .NET 4 Platform". After I load the sample code from MyXamlPad project under Chapter 27 and try to run it, I got an error from the compiler as follows: Error 1 The "GenerateResource" task failed unexpectedly. System.DllNotFoundException: [...] read more
wpf
2votes
2answers

NUnit unit test cannot find a unmanaged dll in the test class

I'have the following situation: 1. I have a delphi dll (unmanaged) that works. I have a win forms application (a proof of concept application) that works. The dll (and all its dependencies) are copied in the Bin/Debug directory of the application. 2. I've createad a .NET managed library which has [...] read more
.net
nunit
pinvoke
1vote
0answers

Unable to load DLL 'DlibDotNetNative': A dynamic link library (DLL) initialization routine failed

When running components using DlibDotNet on Windows Server 2012 I'm getting the following error: > System.DllNotFoundException: Unable to load DLL 'DlibDotNetNative': A dynamic > link library (DLL) initialization routine failed. (Exception from HRESULT: > 0x8007045A) The same release build is working fine in my dev machine. I have checked both [...] read more
c#
face-recognition
dlib
.net-framework-version
1vote
0answers

WPF Spell Check Causes Exceptions on Some Machines

I have an application using spell checking in WPF. For the most part it works great but I have some users that get exceptions like: Retrieving the COM class factory for component with CLSID {7AB36653-1796-484B-BDFA-E74F1DB7C1DC} failed due to the following error: 8007045a A dynamic link library (DLL) initialization routine failed. [...] read more
c#
wpf
com
spell-checking
1vote
1answer

How can I ensure that auth.dll can be loaded?

I'm trying to use crypto++ in c++ clr class library. The problem is that I get an error as I run the app, but it builds successfully. Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'auth.dll' or one of its dependencies. A dynamic link library (DLL) initialization routine failed. [...] read more
c#
c++
clr
crypto++
1vote
1answer

gcc DLL from C#: "DLL initialization routine failed" on Windows 10

I am developing C# DLL that needs a code I have as a C++ DLL, build by gcc. For this, I have written a C wrapper and compiled it using gcc (TDM-GCC MinGW-w64) as a DLL. In other words, I have: * C++.dll built by gcc; plus C++_test.exe that uses [...] read more
c#
c++
visual-studio
gcc
dll
1vote
2answers

Running a CNTK model under a VS unit test

I have trained a CNTK model using C#, and now I want to run test cases against a wrapper class so that we can detect problems if somebody replaces the model with one that doesn't perform as well, and additionally have a repeating comparison of the neural network against our [...] read more
c#
visual-studio
unit-testing
cntk
1vote
1answer

SQLite DLL - Failed to load exception

I'm building an application using VS2010, C#, .NET4 with a SQLIte database in a Windows application, I'm trying to reference System.Data.SQLite which i`ve installed using NuGet into my project. I am referencing methods within the SQLite namespace without any issues, but running the application gives me the below exception, can [...] read more
c#
.net
sqlite
1vote
2answers

NUnit: Could not load file or assembly 'some.dll' or one of its dependencies. The specified module could not be found

I have a C++/CLI DLL that uses some C++ DLLs (both built for 32 bit). I want to test it within a C# DLL by using NUNit 2.5.8.10295 (changing to 2.6.4 did not change the outcome) I use a batch file which in the end gets expanded to this: nunit-console-x86.exe [...] read more
c#
c++
nunit
command-line-interface
badimageformatexception
1vote
2answers

WCF MSMQ DllNotFoundException

I am trying to access a remote WCF service (using netMsmqBinding) hosted in a windows service and am getting the error: Message: System.TypeInitializationException: The type initializer for 'System.ServiceModel.Channels.Msmq' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'mqrt.dll': A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) [...] read more
wcf
msmq
wcf-binding
1vote
0answers

Does CoCreateInstance call indicate that w3wp.exe is starting / restarting?

So I see tons of these errors in the Windows Application Log indicating that a CLR profiler (BMC's ApsAgent Probe in my case) is failing to load. > .NET Runtime version 4.0.30319.18444 - Loading profiler failed during > CoCreateInstance. Profiler CLSID: '{FF51CB90-1C9F-4b50-BA41-D48BDE9823B0}'. > HRESULT: 0x8007045a. Process ID (decimal): 4176. Message [...] read more
asp.net
iis
clr
1vote
1answer

Get image from scanner c#

I want to get image from scanner. I have a simple application in Java, but i have see that not exist a free library to get image directly from scanner. So I have this idea, I create a simple project in C# to get image them call this exe file [...] read more
c#
twain
1vote
1answer

Wrapping a DLL - Understanding why Import Fails

Background I have an embedded system which runs an application originally written in C++ and compiled in Visual Studio, which results in a single executable and more than 30 DLLs. These libraries cannot be browsed in VS Object Browser or other tools such as P/Invoke Interop Assistant. Loading some of [...] read more
c#
c++
dll
dllimport
1vote
2answers

Runtime Error R6034 in C# program

I'm loading in C# a C++/CLI wrapper dll (to a native C++ dll) and if I compile my tool in release mode I'm getting R6034 runtime error and A dynamic link library (DLL) initialization failed. (Exception from HRESULT: 0x8007045A). Scheme: C# tool ---> reference to C++/CLI wrapper ---> static load [...] read more
c#
c++
dll
c++-cli
runtime-error
0votes
1answer

How to solve problems with AppxPackaging.dll (Windows App Certification Kit)?

We receive the follow error message on building an UWP application. > Task 'ValidateAppxManifest' failed. Retrieving the COM class factory for > component with CLSID {5842A140-FF9F-4166-8F5C-62F5B7B0C781} failed due to the > following error: 8007045a A dynamic link library (DLL) initialization routine > failed. (Exception from HRESULT: 0x8007045A). {5842A140-FF9F-4166-8F5C-62F5B7B0C781} pointed to [...] read more
windows
dll
library
sdk
0votes
0answers

File Dialog no longer opening (except for Admin User)

Recently after a windows update, I can no longer open any File / Folder Dialogs. So clicking on File->Open in any application does not work. However when launching applications as Admin, the File Dialogs works fine. So it appears that some kind of permission got screwed up for non-admin users. [...] read more
windows
0votes
2answers

Registration-free COM works on a local machine, but throws exception in Azure App Service

Trying to use a COM library in Azure App Service. The library is 32-bit, and the service is configured to run in 32-bit as well. In order to make it run on a local machine without registration I've created a manifest file, as well as copied custom activation code from [...] read more
c#
azure-web-app-service
com-interop
azure-appservice
0votes
1answer

System.DllNotFoundException: Unable to load DLL 'System.Data.SQLite.DLL': (Exception from HRESULT: 0x8007045A)

Getting error: System.DllNotFoundException: Unable to load DLL 'System.Data.SQLite.DLL': A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) The exe was being run through script in YAML pipeline. The DLL was placed in the same folder as exe read more
powershell
azure-devops
yaml
azure-powershell
0votes
1answer

Use Old .net dll inside Modern .net application

I have a .net dll file called PcapNet.dll this file is a wrapper around C++ WanPacket.dll library. But PcapNet.dll built with .net3.5, every time I reference it in modern .net application eg, .net 4.7 Shows me this message: > System.IO.FileLoadException: 'Mixed mode assembly is built against version > 'v2.0.50727' of [...] read more
c#
.net
.net-assembly
0votes
1answer

Unable to load DLL 'tensorflow' on Windows 2012 R2 Server

I have created an image classifier using ML.Net Model Builer in Visual Studio on Windows 10. It has been compiled in to a Console application. This runs fine on the development machine and other Windows 10 machines. I need to deploy it to a Windows 2012 R2 server but when [...] read more
c#
tensorflow
machine-learning
ml.net
0votes
1answer

aspnet application unable to load unmanaged dll in windows10/iis10

I have a pair of aspnet C# applications that call an unmanaged dll (written in Delphi). The applications are installed on IIS. When any of the two applications tries to call the unmanaged dll the following error is reported (same error in both cases): "Unable to load DLL 'dllName.dll': A [...] read more
c#
asp.net
delphi
iis
dll
0votes
1answer

C#: A dynamic link library (DLL) initialization routine failed

I am trying to replicate some functionality of other app, which uses CyStat.dll. Here is the app itself https://mega.nz/#!sIRggKST!UEeAWgcT9ONbyc0WgFagI-0G36zxvEK1dMwzw3NYd60 It's basically a status monitoring tool for a specific printer My problem is this: I get this error every time I try to use the dll: 'Unable to load DLL 'CyStat.dll': [...] read more
c#
dll
dllimport
0votes
1answer

Cake.git addin throw exception in windows 10

ITNOA Hi, I have a net standard project, and i want to create build script with cake for this project, I download build.ps1 from resource of cake and move it to Build directory, then create a build.cake file like below #addin nuget:?package=Nuget.Core #addin nuget:?package=Cake.Git&version=0.19.0 //#addin "nuget:?package=Cake.Coveralls&version=0.9.0" using NuGet; var target [...] read more
c#
continuous-integration
nuget
.net-standard-2.0
cakebuild
0votes
1answer

Calling C++ DLL from C# is ok under Windows 7 but fails under Windows 10

My program calls a C++ DLL from my C# program. The problem is that the generated executable is running fine undex Windows 7 but not under Windows 10 !? The steps are listed below: I compile my C++ DLL using g++ (of TDM-GCC-64) in 64 bits. I compile my C# [...] read more
c#
c++
dll
language-interoperability
0votes
2answers

Trying to load unmmanaged c++ dll in azure

I'm trying to call to my unmanaged dll from my asp.net mvc web app. when I call this dll from localhost it work just fine. when publish the app to azure and try to call this dll I'm getting this: > Error:System.DllNotFoundException: Unable to load DLL > 'SerenityConfigCodec.dll': A dynamic [...] read more
c++
asp.net-mvc
azure
dll
0votes
0answers

PowerShell from .NET calling MsmqQueueManager

I have a simple PowerShell script which I am trying to call from .NET (vb.net) using the PowerShell.Create method to create the pipeline. The script just calls Set-MsmqQueueManager. The code works fine on my development machine, however, on the Windows Server 2012 R2 server I deploy it to Powershell returns [...] read more
powershell
0votes
1answer

System.IO.FileLoadException with WebService

I'm using Visual Studio 2013 and I am trying to create a webservice using the assembly DNSTools from Nuance SDK. My WebMethod is really simple : I just create an object from a DNSTools' class, then return "Hello World". using DNSTools; namespace WebTestFinal { public class WebServiceTestFinal : System.Web.Services.WebService { [...] read more
c#
.net
web-services
asmx
assemblies
0votes
1answer

A dynamic link library(DLL) initialization routine failed.(Exception from HRESULT:0x8007045A) Error,while using Pinvoke

I have a WPF application which use pinvoke for calling a C++ method dll name as Project1.dll.when I am installing and using it on windows 7 it is working fine but on windows 8.1 it is giving “Unable to load DLL'C:\MyApp3\project1.dll':A dynamic link library(DLL) initialization routine failed.(Exception from HRESULT:0x8007045A)”. Project1.dll [...] read more
c#
wpf
pinvoke
0votes
1answer

Import and use C++ DLL functions in C# application

I am developing an application that communicates with some hardware using the C++ DLL provided by the hardware provider. I also have a header file for this DLL, but no source file. In my C# application, I'm trying to import and call the DLL's functions like this: public class MyClass [...] read more
c#
c++
dll
dllimport
0votes
1answer

DllNotFoundException From C# but not VB.NET

I have a third party DLL to integrate with their application. It is a 32 bit C++ DLL that does not expose itself via COM, and I have not been supplied source code or a header file. It was supplied with working VB.NET example code in a WinForms example. This [...] read more
c#
c++
vb.net
pinvoke
dllnotfoundexception
0votes
1answer

Com DLL Gives Exception .NET 4 only

A COM DLL works in .NET 3.5 SP1, but gives exception in .NET 4.0 The full error is > Retrieving the COM class factory for component with CLSID > {B229C879-1B52-4DE9-A42B-75C415EA1EBC} failed due to the following error: > 8007045a A dynamic link library (DLL) initialization routine failed. > (Exception from HRESULT: [...] read more
.net
com-interop
0votes
1answer

C++ Failure on MSVCR80.dll using Microsoft.SqlServer.Management

I am trying to run test on my server but it fails due to some C++ error coming from MSVCR80.dll. On my machine it runs smoothly but on the server, I do not find a way to make it work. Here is the error I have when running my tests [...] read more
c#
c++
sql-server
-1votes
1answer

C# Azure Function and legacy DLL

I am trying to use Azure Function to do some calculations using a legacy .DLL In my Azure function I have code like this and it works fine locally: [DllImport("calculation.dll", ExactSpelling = false, CallingConvention = CallingConvention.StdCall, EntryPoint = "CreateItem")] private static extern int CreateItem([MarshalAs(UnmanagedType.LPStr)] string applicationName); Running it in azure [...] read more
c#
azure-functions
dllimport
legacy

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0