Jump to content
  • Advertisement
Sign in to follow this  
Merlyn614

[.net] C# DirectX Error, Please Help

This topic is 5474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ;)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!