If i try
const char NoChar = (char)8470;
it will throw a compilation error:
The expression assigned to '{0}' must be constant
As far as I understand, this error occurs because when a char happens because the string concatenation operator ( + ) internally calls a ToString on the concatenated object.
My question is, is there a way (unmanaged?
), to do this.
I need to pass this constant as an attribute, and it needs to be generated on the client.
An in-depth workaround (will see that the uglier one based on your answers ...) is to subclass which attribute (which is sealed, will have to do some decompilation and copy-paste operation) and paste it as non-constant is possible.
source share