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

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

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


CODE:
object newItem = itemType.InvokeMember("Copy", System.Reflection.BindingFlags.DeclaredOnly || System.Reflection.BindingFlags.Public || System.Reflection.BindingFlags.Instance || System.Reflection.BindingFlags.InvokeMethod, null, item, null);
wenyonkAsked:
Who is Participating?
 
dstanley9Commented:
Try using a single | (bit-wise OR).  the || in C# is a "short-circuit" OR, meaning in only works to evaluate logical expressions.
0
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.