The reason I asked this question is that I wanted to create a helper class for Remoting instantiation, and wanted to pass the appropriate app.exe.config (or web.config) file path to the RemotingConfiguration.Configure
method, depending on the caller.
Is there a way I could get the name of the config file for both Win and Web apps without checking if the application is Web or WinForms?
You can use the ConfigurationFile
property on the SetupInformation
for AppDomain.CurrentDomain
.
This will get either the web.config or and app.config (yourprogram.exe.config) location.
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With