You are talking about the config file which is, by the design of CLR, is intended to be in the same directory as the main executable module
of the entry assembly of your application, and it is the subject of the same very schema you described in your question.
Moreover, you don't need to know the location of these file, as it is not designed to be used directly by the application (but it can be used to configure some other paths your application can use, as this is one of the purposes of configuration).
Please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa374182%28v=vs.85%29.aspx[
^],
http://msdn.microsoft.com/en-us/library/2tw134k3.aspx[
^].
You can always find the configuration file, but I'm afraid it would be a misuse of the feature. To find its full path, you can do this:
string location = System.Reflection.Assembly.GetEntryAssembly().Location;
string configLocation = string.Format("{0}.config", location);
If you need something else, you should probably introduce your own config file, encrypted or not. In particular, it's very convenient to use
Data Contract:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[
^].
—SA