Directx 9.0 with C# 2005 Express

I saw some great Webcast videos on MSDN Introducing 2D Gaming with C#. I have downloaded and installed, DirectX 9.0. The videos referenced Visual C# 2005 Express. I downloaded some sample code and tried to run it. The error was it couldn't find the Microsoft.DirectX referenced. I tried to add the referenced in the .NET tab none of the DirectX assemblies were available.

One possible problem is the webcast videos referenced an earlier version of DirectX. Could that be my problem

The other weird thing is that if I run some samples from the Directx directory, they go through the Conversion software (I assume from Visual Studio.NET) but run okay with no problems even though they reference the same Microsoft.DirectX references.

Please advise how I can duplicate the conversion process or add references to a new C# solution.

Two other comments: I cannot locate Microsoft.Directx.dll except in a cab file. There is a Microsoft.DirectX in the c:\Windows\assembly directory.

Thanks,

Michael Suzuki



Answer this question

Directx 9.0 with C# 2005 Express

  • mjbp

    This is a thread I have been helping with from the Express Forums, thought I would move it here as the topic is related more to this group.



  • Jeff.aspx

    Glenn,

    You article was a big help. I installed DirectX 9.0. The problem I am having is that I tried to add a reference in the .NET tab but the Microsoft.Directx files were not listed. (by the way, I looked and found them in the Windows\Assembly directory).

    I did find a workaround that seems to work. I found the Microsoft.Directx dlls in the SDK .cab files, extract them. Then when I went to add a reference, I used the browse button and selected the appropriate dll. I don't know if this is the same thing or not but it got rid of the compile errors anyway.

    Anyway, I am going to try the Feb2006 SDK to see if that works any better. After I downloaded and extracted the SDK, I found it to be confusing as to how to install as there is was an install.exe, a setup.exe and a Microsoft DirectX 9.0 SDK.msi. I think I tried them all and still could not get Microsoft.DirectX to appear under the .NET tab.

    Anyway, I assume and will unistall DirectX 9.0 before I try to install Feb2006 version.

    Thanks for the support and any other suggestions are appreciated.

    Michael Suzuki


  • Thomas Leirer

    Glenn,

    Thanks, I have downloaded and installed DirectX 9.0. But I cannot find away to attach them to Visual C# 2005 Express. I suspect it is a problem (or limitation) of Visual C# 2005 Express but the MSDN webcast specifically stated that the program could be developed with Visual C# 2005 Express.

    I am new to the Express packages and to .NET Framework but I was under the impression that all of the assemblies in C:\WIndows\Assemblies are where the .NET references come from.

    Michael


  • tfs2020

    To use Managed DirectX inside an application you need to make sure that you have the DirectX SDK Installed on your machine. The SDK is a download from the Microsoft Site. Here is a link to the Microsoft DirectX Developer Centre, from there you will be able to follow the links so that you can download the latest SDK.

    For Questions regarding DirectX and Development of Applications using it you should post your messages in the Windows Game Development Groups on this site.

    For some added resources and links to tutorials I would have a look at www.thezbuffer.com or of course my site (In my Signature, but the site will be changing to a new location in the next week or so). I also post information and articles in my blog (http://blogs.virtualrealm.com.au/mykre).



  • remoteend

    Remember that there are 2 parts to the DirectX system. There is the runtime components that you can get from the windows update system, as well as the microsoft downloads site. There is also the SDK which you can also get from the MS Downloads site. The run time is about 20m in size but the SDK is over 200m in size, which one have you installed.

    I do a lot of my programming in the Express products using DirectX, and yes it can handle it. You just have to make sure that you have the correct SDK Installed.

    Here is the direct Link to the SDK Pages on the DirectX Developer Centre: http://msdn.microsoft.com/directx/sdk/

    Here is a Quick article that I have put together to help ading the References: http://blogs.virtualrealm.com.au/mykre/2006/02/15/AddingTheManagedDirectReferences.aspx



  • Directx 9.0 with C# 2005 Express