Simple question, how do you force the C# compiler to throw a compilation error.
Update: Perhaps it\'s better to use an Assert.Fail() instead?
I don't believe this can be done, because it is not possible to tell compiler to check for custom errors. Of course, you can use #error, like Jon said, but there is no way to add the condition itself. Because #error will cause error each and every time.
Only thing you can be sure about is to check at runtime and then throw exception.
Edit: Damn, getting to question after it was heavily edited.