ASP.NET: an external custom configuration file in a virtual directory - how?

I know that there are at least two approaches to using the web.config file:

Now my problem is that both approaches work well only for physical paths . But I need to refer to the configuration file, which is located in the virtual directory .

What other method can I use to host my configuration resources in a virtual directory?

Note. I want to do it like this because I have multiple instances of my web application on the same server (and on many servers). To simplify and simplify the deployment, I want to keep one directory for all files (aspx, ascx, images, css, js, etc.) and specify web applications in IIS for different clients (= domains, https, etc. ) For this, a single directory. On every IIS website, I would have a virtual directory called "custom" that points to a different folder for each network.

Update: I would like to indicate that this "custom" virtual directory is not suitable for the inherited web.config - this web.config file will be valid only for a user folder that does not contain aspx / ascx files.

+3
source
3

, , asp.net .

, - Linux, , , sysinternals. , , asp.net , -. :)

+2

, web.config.

, .

+1

, , , , web.config , IIS , ( , ..) -, webconfig ( DLL ) - .

+1

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


All Articles