Best place to store static error strings

I was wondering if anyone has any input on the best practice of where to store static error strings in a C # application. I have a visual studio 2010 solution that has 5 projects and has identified several persistent error messages that will be returned via the WCF REST web service as a message.

My current errors that I detected (hard-coded) are in the following format (CODE, MESSAGE):

999 - Your request could not be processed with the specified parameters.

I am not asking how to create custom classes derived from the Exception class, because these errors are returned after the corresponding exceptions have been raised to prevent AppPool from appearing.

Some ideas that I have been thinking about storing messages in are: XML, Flat File, SQLite, etc.

Does anyone have a preference, and if so, why?

Thank,

Jeffrey Kevin Pry

+3
source share
1 answer

I personally store these things in Resources files , and then extract them when I need them. Performing this method also makes it much easier to change them, for example, if you need a system to use another language, all you would do is switch the resource file for one to another language and voila!

+4
source

All Articles