[.net] C# DirectX Error, Please Help

Started by
4 comments, last by Oluseyi 19 years, 6 months ago
Hi, Its been a while since I've posted on these forums. I'm working on a new project and figured I would try out C# and Managed DirectX to see how well they work. So I wrote a simple application that should just bring up a window, but when I try to build I get this error for these lines: using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; The type or namespace "DirectX" does not exist in the class or namespace "Microsoft" (are you missing an assembly reference?) I'm not sure what to make of this error. I have Visual Studio .NET 2002 (not 2003) and .NET Framework 1.1 and the DirectX 9.0c Summer Update SDK. Do I have to change something in the project or compiler settings to get the compiler to find these things or did I forget to install something that I need? I'm sorry if this is a stupid question, but I can't seem to find the answer in the documents anywhere and those lines are taken right out of one of the microsoft sample tutorials. Thanks in advance.
Advertisement
Hmmm... well... you should do as the error message tells you to do: set a reference.

Right-click your project 'Add reference' and select Microsoft DirectX....


Cheers
Hmm,

Thanks for the reply, but i can't find Microsoft.DirectX on the list of references...

I'll try re-installing the SDK, maybe I forgot to install part of it. I'll let you know if that helps.
Okay,

So I uninstalled the .NET SDK and the DirectX SDK and reinstalled both of them. Now Visual Studio .NET can't open C# projects because its missing the C# compiler. When I try to fix the install with my Visual Studio disks, it tells me that it needs to unistall .NET Framework 1.1 and install 1.0 instead. In the DirectX docs, I found a note that said Managed DirectX 9.0c Summer update requires Visual Studio .NET 2003 and .NET Framework 1.1. Does this mean I have to buy a new version of Visual Studio .NET just so that I can use the managed DirectX, or is there a way of getting Visual Studio .NET 2002 to work with the files?

Anyone able to use Visual Studio .NET 2002 with Managed DirectX have any advice?

Thanks.
Simple,

VS 2002 doesnt list it in the list of references. You have to browse for it (use the folder with Directx.AudioVideoPlayback because they other's dont seem to work :\ )

Don't tell me that doesnt work, because im makigna game using it now ;)
Ollie"It is better to ask some of the questions than to know all the answers." ~ James Thurber[ mdxinfo | An iridescent tentacle | Game design patterns ]
Quote:Original post by Merlyn614
Does this mean I have to buy a new version of Visual Studio .NET just so that I can use the managed DirectX...?
No, it just means that you fucked up the installation. You'll probably have to reinstall in the following order: VS.NET 2002, .NET Framework SDK, DirectX 9.0c SDK.

As for the references, .NET uses something called a Global Assembly Cache (GAC). When a new system component like DirectX is installed, it is added to the GAC. You should have browsed the assemblies in it (via the VS.NET 2002 interface) for Microsoft.DirectX.Direct3D, etc. It's in there.

You live, you learn, you RTFM.

This topic is closed to new replies.

Advertisement