Open .NET object as COM - What happens with web.config

I have a .NET project that accesses a .config file (usually for web.config) to get configuration information.

If I access this .NET project from a classic ASP application, how does it handle read data from web.config or app.config? Maybe this?

FYI - Using System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration

+3
source share
1 answer

I am sure that the .NET code called through COM Interop will look for the "executable filename..config" in the same directory as the executable file name, where the executable file name is an unmanaged exe (calling process).

For classic ASP, this will probably be% WINDOWS% \ system32 \ dllhost.exe.config. I have a dumb memory that I was doing something similar almost ten years ago.

If you can modify your .NET project, the best option would be to manage your configuration settings in classic ASP code and pass them through the new Configure interface in your .NET library. Or use a different approach (for example, a registry or loading your own configuration file).

0
source

Source: https://habr.com/ru/post/1771798/


All Articles