Erorr in loading DirectX Reference

Dear All,

I have two versions of VS.NET (2003 & 2005) installed and DirectX SDK Dec/2005 version installed as well. I am trying to develop just a few lines of code to create the device but it caused the errors as below:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in TestDX.exe

Additional information: File or assembly name Microsoft.DirectX.Direct3D, or one of its dependencies, was not found.

TestDX.exe!TestDX.Form1.Main() Line 78 + 0x14 bytes C#

I reference to three directX libarary in the the following folders:

C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DLL

C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Direct3D.DLL

C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Direct3DX.DLL

The codes:

public Form1(){

InitializeComponent();

PresentParameters presentParm = new PresentParameters();

presentParm.Windowed = true;

presentParm.SwapEffect = SwapEffect.Discard;

Device device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParm);

}

Could any please let me know how to fix this I would like to develop the DirectX application in VS.NET 2003.

Any recommendation would be highly appreciated.

Regards,

LG

 



Answer this question

Erorr in loading DirectX Reference

  • Juan Carlos Velez

    First things first, does the "Empty Project" for Managed DirectX (located in your DirectX Sample Browser) work   You should use that as your starting point for any code, since it already points to the correct libraries. 

    At the very least, you can look at that sample to determine which libraries you should be pointing to.

     



  • MS MVP KenLin for VB.NET

    David,

    Thanks a lot for your comments. I load the DirectX Sample Browser and it works. Ialready tried the sample in VS.NET 2003 but non-of them works as they cannot find the reference meaning that the location of the DirectX reference location is different from what I installed in my laptop. Even I changed reference to the required directX dll files in folder C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code but it still doesn't work. It caused really the same error message as my previous post.

    I click on some samples executable file it says cannot find d3dx9_28.dll. I don't know why when I installed the directX I have a lot of errors in the log file. I tried to uninstall and reinstall it a few times but the same problems occure.

    Sorry the log file might be a bit too long. I hope this would give better ideas of what's wrong with it. I copied only the error part in the log as it's way too long. Could you please advise how can I make the simple DirectX project running on my laptop

     

    Regards,

    LG

    04/01/2006 - 16:05:58: Found: DirectX for Managed Code
    04/01/2006 - 16:05:58: Attempting to locate files in: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\*.*
    04/01/2006 - 16:05:58: Found: Microsoft.DirectX.AudioVideoPlayback.DLL
    04/01/2006 - 16:05:58: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.AudioVideoPlayback.DLL  (5.04.00.2904)
    04/01/2006 - 16:05:58: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.AudioVideoPlayback.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\1.0.2902.0\Debug\Microsoft.DirectX.AudioVideoPlayback.DLL
    04/01/2006 - 16:05:58: Found: Microsoft.DirectX.Diagnostics.DLL
    04/01/2006 - 16:05:58: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Diagnostics.DLL  (5.04.00.2904)
    04/01/2006 - 16:05:58: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Diagnostics.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\1.0.2902.0\Debug\Microsoft.DirectX.Diagnostics.DLL
    04/01/2006 - 16:05:58: Found: Microsoft.DirectX.Direct3D.DLL
    04/01/2006 - 16:05:58: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Direct3D.DLL  (9.05.132.0000)
    04/01/2006 - 16:05:58: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Direct3D.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\1.0.2902.0\Debug\Microsoft.DirectX.Direct3D.DLL
    04/01/2006 - 16:05:58: Found: Microsoft.DirectX.Direct3DX.DLL
    04/01/2006 - 16:05:58: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Direct3DX.DLL  (9.10.455.0000)
    04/01/2006 - 16:05:58: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Direct3DX.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\1.0.2909.0\Debug\Microsoft.DirectX.Direct3DX.DLL
    04/01/2006 - 16:05:58: Found: Microsoft.DirectX.DirectDraw.DLL
    04/01/2006 - 16:05:58: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DirectDraw.DLL  (5.04.00.2904)
    04/01/2006 - 16:05:58: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DirectDraw.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\1.0.2902.0\Debug\Microsoft.DirectX.DirectDraw.DLL
    04/01/2006 - 16:05:58: Found: Microsoft.DirectX.DirectInput.DLL
    04/01/2006 - 16:05:58: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DirectInput.DLL  (5.04.00.2904)
    04/01/2006 - 16:05:58: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DirectInput.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\1.0.2902.0\Debug\Microsoft.DirectX.DirectInput.DLL
    04/01/2006 - 16:05:58: Found: Microsoft.DirectX.DirectPlay.DLL
    04/01/2006 - 16:05:58: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DirectPlay.DLL  (5.04.00.2904)
    04/01/2006 - 16:05:59: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DirectPlay.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\1.0.2902.0\Debug\Microsoft.DirectX.DirectPlay.DLL
    04/01/2006 - 16:05:59: Found: Microsoft.DirectX.DirectSound.DLL
    04/01/2006 - 16:05:59: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DirectSound.DLL  (5.04.00.2904)
    04/01/2006 - 16:05:59: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DirectSound.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\1.0.2902.0\Debug\Microsoft.DirectX.DirectSound.DLL
    04/01/2006 - 16:05:59: Found: Microsoft.DirectX.DLL
    04/01/2006 - 16:05:59: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DLL  (5.04.00.2904)
    04/01/2006 - 16:05:59: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\1.0.2902.0\Debug\Microsoft.DirectX.DLL

     

    04/01/2006 - 16:06:03:
    Initialize log file
    04/01/2006 - 16:06:03: Command Line: "C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\\Beta\x86"
    04/01/2006 - 16:06:03: System Directory: C:\WINDOWS\System32
    04/01/2006 - 16:06:03: Installing...
    04/01/2006 - 16:06:03: Attempting to locate files in: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\\Beta\x86\*.*
    04/01/2006 - 16:06:03: Found: DirectX for Managed Code
    04/01/2006 - 16:06:03: Attempting to locate files in: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\\Beta\x86\DirectX for Managed Code\*.*
    04/01/2006 - 16:06:03: Found: Microsoft.DirectX.DLL
    04/01/2006 - 16:06:03: File: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\\Beta\x86\DirectX for Managed Code\Microsoft.DirectX.DLL  (9.10.455.0000)
    04/01/2006 - 16:06:03: Error 3.  Failed to install: C:\Program Files\Microsoft DirectX SDK (December 2005)\Developer Runtime\\Beta\x86\DirectX for Managed Code\Microsoft.DirectX.DLL to C:\WINDOWS\Microsoft.NET\DirectX For Managed Code\2.0.0.0_x86\Debug\Microsoft.DirectX.DLL
    04/01/2006 - 16:06:03:
    Closing log file


  • Sung Hon Wu - MSFT

    I finally found the solution for this. I think there might be a problem with Oct or Dec/05 release installation disk of DirectX. I fixed problem by first of all installing DirectX Summer Release 2003 and I found that all required folders and files were created in the C:\WINDOWS\Microsoft.NET\Managed DirectX so that I just installed the Oct release on the top of it. Everything is working fine now.

     

    Regards,

     

    LG


  • Philippe Caron

    Thanks for your prompt response. It's very odd to me as well indeed.

    I do have .NET 1.1 installed on my system. I was trying to fix this problems in the last few days but I couldn't so that I decided to re-formate my machine and install first of all just windows XP SP2, Office 2003, VS.NET 2003 with .NET 1.1 and DirectX Oct/2005. I still get the same error logs and all files were not created and I couldn't run DirectX as well. Problems are still there. I decided to uninstall the OCt/2005 release and installed Summer 2003 release and it works. Then I installed the DirectX Oct/2005 release and reference to those dll files and it works as well.

    I have no ideas why that it doesn't create folders in the Windows in my system unless I have summer 2003 release installed.

     

    Regards,

    LG


  • Franck EMSALLEM

    Very odd. Most people haven't had problems with Oct/Dec so it must be a strange edge case on your machine.

    C:\WINDOWS\Microsoft.NET\Managed DirectX is where old versions used to go.

    Oct and Dec should put files in C:\windows\Microsoft.NET\DirectX for Managed Code. There should be a 2902 directory with all the DLLs then higher numbers with just microsoft.directx.direct3dx.dll becuase each SDK updates that file.

    But glad you are working now. The log file you included does clearly say that it failed to install the managed directx Dlls. THe only reason I currently know for that is not having the .Net framework 1.1 on your machine which is highly unlikley since you have VS2003....

     



  • Erorr in loading DirectX Reference