DLL is attempting managed execution inside OS Loader lock 解决
DLL 'bin/Debug/Microsoft.DirectX.DirectSound.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
至于为什么会出现这个异常,看到某个人的解释是 MS的 Bug,不过可以不显示这个异常,具体方法如下:
菜单栏中的 调试 --> 异常,在弹出的窗口中,把
Managed Debugging Assistants 下的 LoaderLock 的 复选框的勾去掉