Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Assignment in conditional expression is always constant; did you mean to use == instead of = ?
A conditional expression used the = operator and not the == operator.
The following sample generates CS0665:
// CS0665.cs
// compile with: /W:3
class Test
{
public static void Main()
{
bool i = false;
if (i = true) // CS0665
// try the following line instead
// if (i == true)
{
}
System.Console.WriteLine(i);
}
}
.NET feedback
.NET is an open source project. Select a link to provide feedback: