Operator 'operator' cannot be applied to operands of type 'type' and 'type'
A binary operator is operating on data types for which it was not designed. For example, you cannot use the || operator on strings.
The following sample generates CS0019:
public class MyClass { [System.Diagnostics.ConditionalAttribute("DEBUG" || "TRACE")] //CS0019 // try the following line instead // [System.Diagnostics.ConditionalAttribute("DEBUG")] public void TestMethod() { } public static void Main() { } }
In this example, conditional logic must be specified outside the ConditionalAttribute. You can only pass one predefined symbol to the ConditionalAttribute.