I am a little confused about how mstest.exe process app.config dll file.
Pilot project 1:
Pilot project 2:
A unit test DLL, which contains only one test method for reading the value of an application parameter from its own app.config file and writing it to a file.
I am using mstest.exe to call the unit test DLL.
Result:
For 1. The DLL configuration value is not printed.
For 2. the native value of the DLL configuration is successfully read and written to the file.
So, is there something special in mstest.exe ?
Thanks.
I am using SOS.dll for debugging through my unit test DLL. I found that a separate application domain is created for each unit test DLL. And these application domains are different from the name named vstesthost.exe . I believe that the configuration is specific to the application domain . Mstest.exe will create an application domain for each of the test DLLs and upload its own configuration file to the application domain, respectfully.
Hope someone can give a more confident explanation.
How to load a configuration file in AppDomain? - load the configuration file into AppDomain, use this:
AppDomainSetup ad2setup = new AppDomainSetup ();
ad2setup.ConfigurationFile = @ "config file path";
source share