Trouble with device initialization

So I wanted to learn how to use DirectX:
I downloaded VC# 2005 express, and the Dec. 2005 DirectX SDK and installed them.
I started reading through and coding along with Derek Pierson's Tutorial found here.

I was all set until I got to the Device initialization part (A depressingly early stage in the tutorial) because I cannot successfully build the code. The error occurs when I try to make the global device object.
The Error:

Error 1 The type 'Microsoft.DirectX.Direct3D.Device' exists in both 'c:\WINDOWS\Microsoft.NET\DirectX for Managed Code\2.0.0.0_x86\Microsoft.DirectX.dll' 'c:\WINDOWS\assembly\GAC\Microsoft.DirectX.Direct3D\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.Direct3D.dll'

I have references to both DirectX and Direct3D, and have

using Microsoft.Samples.DirectX.UtilityToolkit;
using Microsoft.DirectX.Direct3D;

I read that one of the major advantages of managed code was that having duplicate DLLs was no longer a problem. What gives



Answer this question

Trouble with device initialization

  • Peter Aspect

    Make sure that the 2 assemblies you add references too are of the same version such as MDX for .NET1.1 and MDX for .NET2.0. You might find that you get this problem when you add assemblies from different versions of Managed DirectX.

    I hope this helps.
    Take care.


  • Dullax

    Alright, thanks. I think I'll just start over and use one of the DirectX empty projects. I still do not understand why they made the two objects overlap and yet incompatible.
  • KristinBarker

  • Trouble with device initialization