How can I access the server level IIS connection settings programmatically from a .NET class?

Background

  • We use a reporting tool based on .NET.
  • The reporting tool uses a settings file, which is a pain for updating between environments (does not do conversions, etc.).
  • The reporting tool allows us to write .NET plugins to run at certain times so that I can modify the settings file on the fly
  • We have access to IIS and can add connection settings / strings at this level

goal

I would like to:

  • Simplify your deployment by moving all rows and connection settings to IIS server-level settings.
    • even our developers have IIS available locally, so this will not be a problem for them.
  • Use the .NET plugin that I am writing to connect to the server where the application is located and pull out the connection strings and settings files.

Question

How can I access the server level IIS connection settings programmatically from a .NET class?

Notes / Things to Consider

  • This application does not use web.config.
    • EDIT: Although the application does not seem to use the web.config file, it exists when the application is deployed, so theoretically I can access it through the .NET plugin.
  • These are actually technically 5 different websites. I will implement the plugin in the same way for each website.
  • IIS servers are used only for this purpose, so I want the settings and configuration items to be global in all web applications.
+4
source share
1 answer

you can use the memory cache, the MemoryCache class has been modified to make it usable by the .NET Framework applications that are not ASP.NET applications.

0
source

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


All Articles