简体   繁体   中英

Can a C# .dll that is referenced within a LabView application have access to an app.config file?

I have a C# .dll that is referenced in a LabView application. I need the .dll to gain access to an App.config file. (So that we can use log4Net within the .dll for debugging purposes)

The problem is the entry point for this C# .dll is a LabView app and not a .NET app and as a result no "DOT_NET_APP.exe.config" exists for this .dll

I've tried "LABVIEW_APP.exe.config" just to see if it COULD log and I get nothing. No log files are created. I've also tested to ensure that the log4Net configuration is correct. (Created a dummy .net console app and tested the C# .dll)

Is there a way for a .DLL to be explicitly told where to look for its configuration file? Can I override the default behavior that causes it to look for "DOT_NET_APP.exe.config" and provide my own?

使用带有"APP_CONFIG_FILE"参数的AppDomain.GetData()来查找配置文件的位置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM