Distributing VB.NET App...What is causing System.DllNotFoundException

1

I've successfully built and tested a vb.net app in VS 2008 that uses a dll (abcTest.dll) built by another developer. However, when I deploy the application to another machine (Release directory contents), I get "System.DllNotFoundException" when I run the executable. The dll is in the same directory as the executable, etc. The solution has the dll as a "Solution Item" so it seems to be reference alright. Here is the actual error I am seeing:

************** Exception Text **************
System.DllNotFoundException: Unable to load DLL 'abcTest.dll': This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
   at AbcCoreInterface.AbcCoreInterface.AbcOpenMap(String filename, UInt32& mapHandle)
   at AbcMapControl.AbcMapControl.Open(String fileName) in C:\dev\ACME\AbcMapControl\AbcMapControl\AbcMapControl.cs:line 508
   at VisualBasicMapTest.Form1.Form1_Load(Object sender, EventArgs e) in C:\dev\ACME\VBMapTest\VisualBasicMapTest\Form1.vb:line 39
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Basically, it seems like it can't load the dll because it can't find it and I'm not clear on why.

.net
vb.net
visual-studio-2008
asked on Stack Overflow Mar 9, 2010 by GregH

1 Answer

1

It is dying on a Windows error, 14001 = ERROR_SXS_CANT_GEN_ACTCTX, "The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail."

Look in the Windows event log for the manifest entry that causes the problem. This is usually due to a unmanaged C/C++ runtime DLL dependency that wasn't installed on the target machine. Also make sure that the dev didn't give you the Debug build of his DLL.

answered on Stack Overflow Mar 9, 2010 by Hans Passant

User contributions licensed under CC BY-SA 3.0