By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,194 Members | 1,655 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,194 IT Pros & Developers. It's quick & easy.

Problem with C# and DirectX SDK

P: n/a
Hello all,

I have some C# code that implements calls to DirectX.DirectSound. It
compiles under both VS .NET 2003 and VS 2005 and runs under VS .NET 2003
and VS 2005 on a Compaq laptop (Windows XP Home), a Dell Xeon
workstation (Windows XP Pro) and a Gateway GM 825 (Windows XP Media
Center). It also runs on the Dell and the Compaq under VS 2005, but
when I attempt to run the code under VS 2005 on the Gateway (Windows XP
MCE), I get errors when attempting to dynamically allocate legal classes
under DirectX 9.

Specifically, this call

soundDevice = new Microsoft.DirectX.DirectSound.Device();

raises the following exception

{"Could not load file or assembly 'Microsoft.DirectX, Version=2.0.900.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file
specified.":"Microsoft.DirectX, Version=2.0.900.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"}
Just to repeat, this exception IS NOT RAISED when running on VS .NET
2003 OR VS 2005 on both the Compaq laptop and the Dell Xeon.

All computers have the December 2005 DirectX SDK installed.

I tried to add Microsoft.DirectX (2.0. ... ) as a reference to the
project, but this code would not compile, citing a duplication of
resources between Microsoft.DirectX and Microsoft.DirectX.DirectorSound
as follows:
1. Error 1 The type
'Microsoft.DirectX.DirectSound.BufferDescription' exists in both 'c:
\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0
\Microsoft.DirectX.DirectSound.dll' and 'c:\WINDOWS\Microsoft.NET
\DirectX for Managed Code\2.0.0.0_x86\Microsoft.DirectX.dll' C:
\Documents and Settings\Owner\My Documents\Projects\Patton Design\BL\GUI
\NGXSound.cs 63 53 GUI

and

2. Error 2 The type 'Microsoft.DirectX.DirectSound.Device' exists
in both 'c:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0
\Microsoft.DirectX.DirectSound.dll' and 'c:\WINDOWS\Microsoft.NET
\DirectX for Managed Code\2.0.0.0_x86\Microsoft.DirectX.dll' C:
\Documents and Settings\Owner\My Documents\Projects\Patton Design\BL\GUI
\NGXSound.cs 73 24 GUI

I've removed and reinstalled the DirectX SDK several times, but can't
remove this error.

I seem to recall that others have talked about certain situations where
the DirectX SDK installer doesn't allways correctly install the DirectX
framework. This may be one of those times.

Does anyone have a workaround or manual way to verify the install of the
DirectX SDK?

TIA

Harvey

Dec 26 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.