简体   繁体   English

找不到参考 Microsoft.DirectX

[英]Unable to find the reference Microsoft.DirectX

I am VERY new to DirectX.我对 DirectX 非常陌生。 I have made a small Kinect-based wpf application in C#, and I want to use DirectX APIs for working with 3D models and Kinect.我用 C# 制作了一个基于 Kinect 的小型 wpf 应用程序,我想使用 DirectX API 来处理 3D 模型和 Kinect。

I have done a lot of search, but am still unable to find the reference to Microsoft.DirectX.我已经做了很多搜索,但仍然无法找到对 Microsoft.DirectX 的引用。

I right click references -> Add Reference.我右键单击引用 -> 添加引用。 Then I browse to C:\\Windows\\Microsoft .NET\\ but there is no folder named DirectX or similar.然后我浏览到 C:\\Windows\\Microsoft .NET\\ 但没有名为 DirectX 或类似名称的文件夹。

And that's why when I write这就是为什么当我写

using Microsoft.DirectX;使用 Microsoft.DirectX;

it gives me an error它给了我一个错误

The type or namespace name 'DirectX' does not exist in the namespace 'Microsoft'(are you missing an assembly reference?)命名空间“Microsoft”中不存在类型或命名空间名称“DirectX”(您是否缺少程序集引用?)

Please explain to me where I can find the assembly reference and add it in the project??请向我解释在哪里可以找到程序集参考并将其添加到项目中?

I am using Visual Studio 2015 on Windows 10, 64 bit我在 64 位 Windows 10 上使用 Visual Studio 2015

Assuming you are trying to use a .NET wrapper for DirectX, that namespace was available as part of DirectX 9.0 for Managed Code , which was abandoned by Microsoft around a decade ago in favor of XNA, which is also now abandoned.假设您正在尝试为 DirectX 使用 .NET 包装器,那么该命名空间可作为DirectX 9.0 for Managed Code 的一部分使用,该名称空间在大约十年前被 Microsoft 放弃,转而支持 XNA,现在也已放弃。 I forget whether XNA kept the Microsoft.DirectX namespace.我忘记了 XNA 是否保留了 Microsoft.DirectX 命名空间。 There was also managed DirectX support on Windows Phone for a while.在 Windows Phone 上也有一段时间的托管 DirectX 支持。 These days if you want a managed wrapper for DirectX on Windows desktop, your best bet is probably SharpDX , which is still under active development.如今,如果您想在 Windows 桌面上为 DirectX 托管包装器,那么您最好的选择可能是SharpDX ,它仍在积极开发中。 (Be aware, though, that SharpDX doesn't use the same class structure as Managed DirectX or XNA, so whatever documentation you have that's referencing Microsoft.DirectX probably won't be much use to you when working with SharpDX.) (但请注意,SharpDX 不使用与 Managed DirectX 或 XNA 相同的类结构,因此在使用 SharpDX 时,您拥有的任何引用 Microsoft.DirectX 的文档可能对您没有多大用处。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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