In Solution Explorer, right-click the project and then click Properties.
In the Project Properties dialog box, expand the node next to Configuration Properties and select General.
In the right pane, under Project Defaults,
set Common Language Runtime support to Common Language Runtime Support (/clr).
Under Configuration Properties, expand the node next to C/Cpp and select General.
Make sure that Debug Information Format is set to Program Database /Zi (not /ZI).
Select the Code Generation node.
Set Enable Minimal Rebuild to No (/Gm-).
Also set Basic Runtime Checks to Default.
Under Configuration Properties, select C/Cpp and then Code Generation. Make sure that Runtime Library is set to either Multi-threaded Debug DLL (/MDd) or Multi-threaded DLL (/MD).
For every MIDL-generated file (C files), right-click the file in Solution Explorer and then click Properties.
Under Configuration Properties, expand the node next to C/Cpp and select General.
Set Compile with Common Language Runtime support to No Common Language Runtime support.
와 같이 하면 잘 실행 됨.