.netinvalid-charactersresourcestring

Reference for invalid characters in Resource String Names? Is a ":" allowed?


I did a quick check on MSDN followed by a quick search here but I did not find anything definitively stating what characters are/are not allowed in .net resource string names. Currently I am trying to find out if a ":" is allowed, but I would prefer to find some reference that covers all cases.


Solution

  • Colon is not allowed on resources names. If you try it, you'll get

    The resource name XX:XXX is not a valid identifier

    For resources names applies the same rules as for variables. If you inspect the .designer file you'll see that for every string resource you defined a property is created so it needs to follow the same naming rules.