I'have the following situation:
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.
I've createad a .NET managed library which has a class that is a wrapper around the dll. all the dependencies of the dll and the dll are copied in the /Bin/Debug folder.
In my unit test project for the managed library I've created a unit test for the wrapper class. When I run the unit test the following error is shown:
DAEcommerce.Logic.Tests.Infrastructure.L3.L3DatabaseConnectionTest.OpenClose_ProperParameters_ActiveSetToTrueAndFalse: System.DllNotFoundException : Unable to load DLL 'AttrbInterface.dll': A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)
The dll in question is copied in the Bin/Debug folder of the unit test project. I've tried also copying it to Windows/system32, adding it to the windows path and copying it in the folder where the NUnit exe is located. It just doesn't work.
I have the following questions:
I had a similar issue with 7z.dll and SevenZipSharp on a 64-bit system. 7z.dll was 32-bit, so I had to make sure that nunit-x86.exe
is used. I also had to turn off shadow copying in NUnit settings, not sure why, but it wouldn't load 7z.dll otherwise.
Try using the Fusion Log Viewer utility to from the Windows SDK to obtain more information about what's actually happening when your .NET assembly is loaded.
User contributions licensed under CC BY-SA 3.0