Operator '||' cannot be applied to operands of type

I am reciving the following error on the following code can someone please help?

Error  10  Operator '||' cannot be applied to operands of type 'System.Reflection.BindingFlags' and 'System.Reflection.BindingFlags'

object newItem = itemType.InvokeMember("Copy", System.Reflection.BindingFlags.DeclaredOnly || System.Reflection.BindingFlags.Public || System.Reflection.BindingFlags.Instance || System.Reflection.BindingFlags.InvokeMethod, null, item, null);
Who is Participating?
Try using a single | (bit-wise OR).  the || in C# is a "short-circuit" OR, meaning in only works to evaluate logical expressions.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.