I would answer NO because the compiler (at compilation time) can't know the value of the parameter at run time.
Have a nice day,
Alberto
EDIT: Check the first comment to your question because it's a more complete answer compared to this one :)
Question
I was wondering either it is possible to create a rule in C# inside the code, that will prevent from "compiling" and print an error message of my choice. For example:
Let's say:
I know I could use assertion and stuff, but that is working on already compiled code.
Solution
I would answer NO because the compiler (at compilation time) can't know the value of the parameter at run time.
Have a nice day,
Alberto
EDIT: Check the first comment to your question because it's a more complete answer compared to this one :)