简体   繁体   中英

The type or namespace name 'DirectX' does not exist in the namespace 'Microsoft' Windows 8.1

I'm trying to draw some boxes in 2D in C#, but when I try the following:

using Microsoft.DirectX;
using D3D = Microsoft.DirectX.Direct3D;

I get the error:

The type or namespace name 'DirectX' does not exist in the namespace 'Microsoft'

Apparently I need the DirectX SDK but I'm on Windows 8.1 and the downloads are for Windows XP.

Starting with Windows 8, the DirectX SDK is included as part of the Windows SDK. Therefor you will need to download the Windows SDK as described in the following MSDN article:

http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275%28v=vs.85%29.aspx

You can find the download link here:

http://msdn.microsoft.com/en-us/windows/desktop/aa904949

Managed DirectX 1.1 is deprecated. It has a number of limitations:

  • No support for .NET 4.x or later (it was written for .NET 1.1 and basically works with .NET 2.0 and 3.x) which means it doesn't work with VS 2010 or later.
  • No support 64-bit (x64) apps
  • No support for Direct3D 10.x or 11.x (it was last updated in April 2006)
  • No support for Windows Store apps, Windows phone apps, or Xbox One
  • It depends on the legacy D3DX9 library
  • The assemblies can only be deployed via the legacy DirectSetup and that requires the .NET 3.x runtime is enabled (which is off by default on Windows 8.x). See DXSETUP Update

If you want a more modern drop-in replacement for the legacy MDX assemblies, see SlimDX . SharpDX is another option and works for Windows Store apps / Windows phone apps.

See DirectX and .NET

Note that you can use the legacy DirectX SDK with the current Windows 8.x SDKs that come with VS 2012 or VS 2013 for C++, but this requires some editing of C++ paths. See MSDN

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM