Sometimes when writing texts describing an error that occurred in the code, we are faced with the fact that this text is duplicated from error to error in different blocks of code. Sometimes, when editing a code or if it is a banal desire to rephrase the text of the error written earlier, it becomes necessary to edit the text accompanying the error. Since the same text can be spread across several files, the editing process of the accompanying text error turns into pain.
- Is it possible to use resource files (.resx) in projects such as - .dll to store the text shown to the user when generating errors? (I know that technically it is possible in WPF. But I don’t know if there are any technical details when working with these files in .dll).
- Is it normal practice to use .resx files to store text errors?
- If possible, comment on the existing alternatives to simplify the work with duplicate text errors.
PS: I know that resource files (.resx) are for localization. I just want to hear opinions about the idea that has appeared in my head, which simplifies the work with the text of errors.