Marking all methods '_declspec(noinline)' prevents the warning. Changing the static constructor to an explicitly called static ...