After running, the program will not come out of the window, just like entering a dead loop.
Solution:
UseLegacyV2RuntimeActivationPolicy=" True;
Modify the App. config file
<? XML version" 1.0; Encoding" Utf-8; >
< Configuration>
< Startup useLegacyV2RuntimeActivationPolicy=" True>
< Supported runtime version=" V4.0" SKU" NETFramework, Version= V4.0" />
</ Startup>
</ Configuration>
DirectX DirectSound.dll is attempting to execute managed code within the OS loader lock. Do not attempt to run managed code within DllMain or image initialization functions as this can cause the application to hang.
1. Debug VS menu -> Exception -> Managed Debuggin Assistants -> Remove the selected state of LoaderLock
2. If the exception option is not available, go to Tools ->Customize ->Command tab ->Select Debugging on the left ->Drag the exception to the menu on the right
3. Shortcut Ctrl+ Alt+ E. Modify Managed Debugging Assistants -> Remove the selected state of LoaderLock.
Solution 2:
1. At HKEY_ LOCAL_ Machine Software Microsoft Add a String under the NETFramework with a value of" 0"
2. However, by doing so, all on this computer are based on NET2.0 development cannot benefit from MDA.