2

I have a .NET assembly A with app.config settings file generated by framework. Actually, it is called A.dll.config. I want to access and modify this settings file from another .NET assembly B. The problem is, the A.dll.config file for A is located somewhere in the current user profile directory, as it should be, and I don't know where to find it. I know only where the assembly A is located.

So, how can I locate the app.config file given the path to the assembly?

The other question is, what if the assembly A was not loaded at the first time I'm trying to access its configuration file from the B? I assume, the configuration file is not generated at this time. Is it possible to manually load the A to force it to generate appropriate configuration file?

4

0 回答 0