Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problem is that calling a .NET dll via COM interop from ASP will load the .NET dll into the default AppDomain. The .NET dll will have no awareness of ASP.NET, web.configs, current IIS request etc that a dll loaded into a ASP.NET app domain would. It is as if it has been loaded simply by some running exe which in fact is the case.</p> <p>The configuration information that your dll will have access to will be the config file for the w3wp.exe. Hence one way to get this config information in your dll (although you understand I'm not actually recommending this approach) is to add a <code>w3wp.exe.config</code> file to the <code>windows\system32\inetsrv</code> folder. This of course is a horrible thing to do and you shouldn't do it.</p> <p>What I would actually do is create a COM visible class whose job it is to expose some properties that represent the various configuration settings. The property setter would assign values into the dll's static space. Then add to the Application start event in the ASP app's Global.asa file some code to instance this object and assign the configuration values.</p> <p>The dll would internally refer to the static values that are set by the above code.</p> <p>Note that all ASP applications that run in the same app pool would need to have identical configuration since they will share the same app domain. This is better than the other approach where all ASP applications on the same machine would end sharing a common configuration.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload