Select windows runtime in "targets" tool, use "/MDd" flag only when building with optimize="none" and optimize="debug".