tags:

views:

1589

answers:

7

hello,

when i try to launch my c# application on another computer than it was developed i get the following error message:

System.IO.FileLoadException: Could not load file or assembly 'Widgets3D, Version=1.0.3511.25568, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

File name: 'Widgets3D, Version=1.0.3511.25568, Culture=neutral, PublicKeyToken=null' ---> System.Runtime.InteropServices.COMException (0x800736B1): This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

i checked with dependency walker and process monitor but couldnt find any missing DLLs. especially the one mentioned in the error Widgets3D.dll is there!

both PCs are up to date with the latest XP service pack and updates. the application works on many PCs here. there is just this one which is making the problem.

EDIT: as suggested i tried to regsvr32 the missing dll, but that gives me this error:

LoadLibrary("./Widgets3D.dll") failed - This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

thanks!

+2  A: 

Reading that exception, here is the important part:

System.Runtime.InteropServices.COMException

That's not a .Net assembly. It's a COM dll, and it needs to be registered.

Joel Coehoorn
thanks. what exactly do you mean by registered? yes the dll is a cpp-library.
clamp
See preet's answer for how to do it.
Joel Coehoorn
+2  A: 

Does the widgets3d need to be installed? Try Regsvr32 over it on the other machine.

Just open a command window and run:

Regsvr32.exe path-to-your-widgets3d.dll

and try again.

You're load library error seems to indicate that other associated dll's required by the 3d library are possibly not registered on the target machine. Try running the installer for the the 3d library on the machine.

Also check this post

Preet Sangha
thanks, but sorry i dont understand what you mean by regsrvr32? the widgets3d.dll is a c++ library
clamp
It's a c++ library, but it's exposed via COM, thus you need to run the command explained in the above answer. Did you try it?
Joe
yes i did. see my edit for the error message. the third party library that Widgets3D.dll uses is ogre3d. but this has always been working. all the ogre dlls are there in place.
clamp
+1  A: 

i checked with dependency walker and process monitor but couldnt find any missing DLLs.

There's no need of doing this. Just go to Start -> Run -> regsvr32 <path of Widgets3D.dll>\Widgets3D.dll -> Press Enter.

Done!

Kirtan
thanks. i tried this, but i get another error. see my edit.
clamp
+1  A: 

Widgets3D.dll probably depends on the C++ runtime libraries. Grab the appropriate "Visual C++ Redistributable" for the compiler it was built with and run that on the target system. You can't download debug DLLs from Microsoft, so hopefully it was built in a release configuration.

ChrisV
thank you! i tried to install the vcredist_x86.exe for VS2005, but still i got the same error message as before.
clamp
As I said, make sure it's not built in Debug. Also, check the system event log in Administrative Tools; you can sometimes get more meaningful error text there.
ChrisV
+1  A: 

Aaah, DLL-hell I presume. It may be useful trying to unregister it and register it again. If it has recently been moved since last time it must be relocated first to be unregistered before being registered again. I have experienced this a lot using COM dlls.

Hope this helps.

markoo
thank you, but even when i try to unregister it, i get this error message: LoadLibrary("Widgets3D.dll") failed - This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
clamp
A: 

just in case you are interested. we found the solution to the problem to be a recent security patch for VC KB971090

uninstalling this patch and rebuilding the DLLs solved the issue.

there are quite a few topics on this: http://stackoverflow.com/search?q=KB971090

clamp
+1  A: 

Uninstalling is one way of dealing with the problem but if you have an ATL component that is vulnerable, you'll definitely want the security patch and make the necessary changes to your app to take advantage of the security fixes.

The way I dealt with this is to develop a workaround that allows the patch to be installed but still target the old versions of the DLLs when building. I've described this solution here.

Ted.