Jacob
Jacob

Reputation: 1295

Identifying the effective config file

I have run into several instances recently where I have had trouble figuring which .config file a given application or DLL is referencing. I've been able to figure it out through some trial and error, but I'm hoping there is a better way. I'd really like to hear some suggestions.

Thanks!

Upvotes: 4

Views: 110

Answers (2)

Tom Duckering
Tom Duckering

Reputation: 2737

If it's running then you can use Process Explorer (by Sysinternals, now Microsoft) to examine the file handles a process has.

Hope that helps.

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1039298

Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
Console.WriteLine(config.FilePath);

Upvotes: 5

Related Questions