11
votes

I have some DirectX projects written in C# that I need to run via Visual Studio 2012 specifically.

All of these projects use the namespace called, "Microsoft.DirectX".

Microsoft Windows SDK installed completely and successfully on my Windows 8 computer, however this namespace is still unrecognised.

My question is, "How do I run and develop DirectX apps using a combination of C#, Visual Studio 2012 and MS Windows SDK?"

3
Win8/VS2012 supports DirectX for C++ only (out of the box). If you want to use DirectX then C++ is the language to use (this is what Microsoft says). Anyway, what kind of App do you want to develop? Metro or Desktop for Win8? Compatible with Win7, too? What kind of .Net version do you want to use? This is important when choosing the technology/library to call DirectX from managed code (Metro has some restrictions and older .Net versions might not work together with your framework).Beachwalker
... I would give SharoDX a try (API is very similar and your sample projects should be easy modify to use SharpDX). This is also a point for SlimDX but afaik SharpDX is faster.Beachwalker
Now I don't really need to develop new app. I want to open these projects just to see how they work. If i start to develop new app I will probably use one of the wrappers.Radek Wyroslak

3 Answers

9
votes

I would recommend you to have a look at SharpDX. This is a thin managed access to DirectX and the API is very similar to the unmanaged version (SharpDX is automatically built from the unmanaged c++ header files). AFAIK this is currently the fastest managed aproach to use DirectX.

A very important thing might be the fact that you are able to develop Win8-Metro-Apps, too. AFAIK this is not possible/allowed with every other lib. I mentioned this because you wrote you want to develop on/for Win8 but you didn't said what kind of app. Metro-Apps has some more restrictions than Desktop-Apps for Win8.

Managed DirectX is out of date as already mentioned. But it seems that XNA is also not longer maintained since the release of the last version 4. So you are stuck if you want to use modern DX10 or DX11 because XNA uses DX9. An alternative here is the ANX framework. This project is currently in an early development stage but seems promising to me. ANX can use DirectX for rendering and uses SharpDX in this case. In contrast to XNA (which is strongly related to only DirectX9) SharpDX has the ability to use other renderers, too (e.g. OpenGL for Linux).

3
votes

Managed DirectX is obsolete and no longer maintained by Microsoft as it is being replaced by XNA. Last version to support Managed DirectX was this one (February 2010 release).

You can also give SlimDX a try :

SlimDX is a free open source framework that enables developers to easily build DirectX applications using .NET technologies such as C#, VB.NET, and IronPython. It is designed to be an efficient, simple, and lean wrapper that fully encompasses all of Microsoft's gaming and multimedia technologies and exposes them to managed code. All of the code is under the MIT/X11 license, and all content is under the Creative Commons Attribution-Share Alike license. Our latest release is March 2011, and can be found for users and developers on the Download page.

1
votes

You will probably need Microsoft XNA.