[SlimDX] Could not load file or assembly (one more time)

Started by
9 comments, last by Pseelo 15 years, 4 months ago
Hi. I've just installed SlimDX library on my second computer. Everythings goes fine on the first computer - my apps and SlimDX samples compile & work perfectly. But when I try to run anything using SlimDX on the second PC, I get the alert: "FileNotFoundException was unhandled" "Could not load file or assembly 'SlimDX, Version=2.0.5.39, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9' or one of its dependencies. The system cannot find the file specified." I tried to reference SlimDX.dll through: GAC (SlimDX install dir), the app dir (copied from SlimDX install dir), and even WINDOWS/system32. No effect. I installed the newest DirectX (as in the thread: http://www.gamedev.net/community/forums/topic.asp?topic_id=512711). No effect. Some info that may be helpful: 1. I use MSVS2008 + Service Pack 1, C# 2. When I try to run SimpleTriangle demo I get another exception alert: "TypeInitializationException was unhandled" "The type initializer for 'SampleFramework.Game' threw an exception." 3. SimpleLighting gives me something similar to my app's alert: "Could not load file or assembly 'SlimDX, Version=2.0.5.39, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)" Can anybody tell me what's wrong? Best regards. Chris [Edited by - Pseelo on November 24, 2008 9:12:30 AM]
Advertisement
That second PC is going to need the Visual C++ 2008 redist. We got rid of this dependency with the November 2008 release. See this page for more information.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
I hate to say it, but this doesn't help me.
I downloaded and installed the "vcredist_x86.exe". No change.
I uninstalled it and SlimDX and installed them back in the reverse order. No change. I repeated this and restarted the PC. Nothing changed - still getting the same exceptions as before.

Any other ideas?

Regards.
Chris.
I thought that maybe the stacktrace from the SimpleLighting would help:

at SimpleLighting.SimpleLighting..ctor()
at SimpleLighting.Program.Main() in c:\\Program Files\\SlimDX SDK (November 2008)\\Samples\\Direct3D9\\SimpleLighting\\Program.cs:line 31at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading.ThreadHelper.ThreadStart()

Chris.
Fire up Dependency Walker, load SlimDX into it, and see what happens. Specifically, collapse the tree and just check if it reports any of the top level DLLs missing. It usually fails to load some of the nested dependencies properly (ie the things lower down in the hierarchy), so we're not interested in that.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
OK. I installed DependencyWalker and loaded SlimDX.dll into it.
Take a look at the screenshot I made: http://img232.imageshack.us/img232/2776/dwgm6.gif

As you see there are three problems with dependencies:
1. The system can't locate the MSVCR80.DLL when it is used as a forwarded dependecy (from MSVCM80.DLL and MSVC80.DLL) but you can observe it doesn't have this problem with implicit dependency from SLIMDX.DLL (the first dependency in the tree).
2. There are three missing DLLs used as delay-load dependencies (D310.DLL, DWMAPI.DLL, DXGI.DLL)
3. There are some missing export functions in three DLLs (D39.DLL, MPR.DLL, SHLWAPI.DLL) - I think that should be considered as a warning, because they probably (in which I want to believe) won't be used.

Anyway -
I tried to simply copy MSVCR80.DLL to windows/system32 to get rid of the first problem. It worked, but left me with the second one (and possibly with the third as well). As I don't have any of the mentioned libraries on my PC my questions are:

- Where can I find them (preferrably in one package if it's possible)?
- Why does actually all this mess happen? The system is freshly installed (I installed Win32 XP (+SP3) + DirectX9 November 2008 + VS2008 (+SP1) + SlimDX November 2008 two days ago). I understand that I needed MSVCR80.DLL from Visual C++ 2008 Redist SP1, but what with all the rest missing DLLs?
- How all these affect users of my compiled app? Let's say I want to distribute my app. I understand that I have to make the user install DirectX Redist and SlimDX Redist, and this is perfectly normal, but will he have to install VC++ Redist or anything else?

Best regards.
Chris.
If you don't use DirectX10, then you don't need D310.DLL, DWMAPI.DLL, DXGI.DLL files.
As for third point - are you sure you have installed DirectX redist that corresponds to SlimDX version used?
Installing SlimDX redist will automatically install needed files from DirectX redist. So if you are installing/redistributing SlimDX redist, then you don't have to worry about DirectX files.
Thank you for the answer.

I actually checked what DWMAPI.DLL is and found out that it goes with Vista only. So I believe you that D310.DLL and DXGI.DLL are also only for DX10.
OK. Let's get back to the files I installed:

- directx_nov2008_redist.exe (latest DirectX web installer dxwebsetup.exe wasn't able to download its files so I used this redist)
- SlimDX SDK (November 2008).exe
- SlimDX Runtime (November 2008).msi
- vcredist_x86.exe

Is anything wrong with them? If so, where can I find the correct ones?

Regards.
Chris.
In the meantime I installed TwinsVisions (application that uses SlimDX). It runs (Murphy would add "of course"). I hoped that libraries installed with it would make my app run as well. Yeah, right. Of course they didn't. (BTW: Visions uses some old SlimDX version, which dragged into DependencyWalker gives exactly the same missing DLL list, as on the screenshot I linked above)
Just to be on the safe side I've just installed DirectX SDK November 2008. Of course nothing moved in the right direction.

I've really got no other ideas.
Help, please!

Chris.
Well, you're not missing any DLLs...MSVCR80 not being found by DW as a forwarded dependency is normal, as are the missing Vista DLLs. However, in your original post it's trying to load SlimDX 5.39, which is September and uses the August DX SDK. What version of SlimDX did you give it? If it's configured to look specifically for that version, which it appears to be, it's going to refuse to load other versions like the November release (which is 6.40).

In short, did you reference September SlimDX and try to substitute November SlimDX? That won't work. If this is the case, I suggest going back and recompiling your app to reference 6.40, and use the new and vastly improved redist installer.
Quote:Original post by Pseelo
- directx_nov2008_redist.exe (latest DirectX web installer dxwebsetup.exe wasn't able to download its files so I used this redist)
You've been having that problem lately too, huh? I thought it was just me.

[Edited by - Promit on November 25, 2008 8:01:57 AM]
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement