Visual Studio 2017上的Microsoft DirectX Sound [英] Microsoft DirectX Sound on Visual Studio 2017

查看:73
本文介绍了Visual Studio 2017上的Microsoft DirectX Sound的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Visual C#2010制作的旧程序.现在我将再次使用它,因此我尝试在Visual 2017 Community上进行编译,但它在MicrosoftDirectSound上启动了Exception.我知道这是因为是32位的,所以我会问您是否有任何解决方法来实现该DirectX,或者在新情况下必须使用什么方法.我也尝试过使用"corflags",但它会返回有关强命名签名的警告.

I have an old program made with Visual C# 2010. Now I would to use it again so I tried to compile on Visual 2017 Community but it launch an Exception on MicrosoftDirectSound. I understood that it's because is on 32bit so I would ask you if there is any workaround to implement that directx or alternatively what I have to use in the new scenario. I tried with "corflags" too, but it returns a warning about strong named signed.

System.BadImageFormatException: ... is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

推荐答案

Microsoft.DirectX.DirectSound 是旧的Managed DirectX 1.1程序集的一部分.它们仅支持.NET 1.1和.NET 2.0运行时,而不支持现代的.NET 4.x运行时.如您所注意到的,您还必须强制使用/platform:x86 .

Microsoft.DirectX.DirectSound is part of the legacy Managed DirectX 1.1 assemblies. They only supported for the .NET 1.1 and .NET 2.0 Runtimes and not the modern .NET 4.x Runtime. You also as you note have to force the use of /platform:x86.

您最好的选择是使用 SlimDX ,该替代品旨在替代托管对象.DirectX 1.1程序集包括x64支持.一个更现代的解决方案是 SharpDX ,但是您当然不应该在新应用中使用DirectSound无论如何.

Your best option is to use SlimDX which is intended as a drop-in replacement for the Managed DirectX 1.1 assemblies including x64 support. A more modern solution is SharpDX, but of course you probably shouldn't be using DirectSound in a new app anyhow.

请参见 DirectX和.NET

要记住的另一件事是,在启用了.NET 2.0/3.x运行时的系统上,仅由传统DirectX SDK或已弃用的DirectX最终用户运行时重新分发程序包安装传统DirectX托管DirectX 1.1程序集.请参见不是这样的DirectSetup 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆