0

We have a classic ASP service, which loads a .net com object via a call to CreateObject passing in the name of the COM object. This COM object then gets passed the name of a pure managed class & dll to load and activate, which it does via reflection. These classes all live in a specific folder and they all get found no problem.

When this .NET instance is activated it then reads some config using a configuration provider class. The config looks like this:

<configuration>
  <configSections>
    <section name="FilesConfiguration" type="Company.Configuration.XmlSerializerSectionHandler, Company.Configuration"/>
  </configSections>
  <FilesConfiguration>
      <RootFolder>\\Server\Path\</RootFolder>
  </FilesConfiguration> 
  ....
  </configuration>

As the config is for w3wp.exe we use an external config file (Company.Configuration.dll.config) and set the config reader to use this as outlined here.

The problem is that the config claims not to be able load the configuration provider class Company.Configuration, even though its in the same folder as the assembly that we just dynamically loaded.

When I turn on fusion logging it is trying to load it from

C:/Windows/SysWOW64/inetsrv/

and if I put it in there then it loads it ok.

So my question is, how can I get IIS to look in the folder that everything else is living in and it is happily finding when it is trying to load the configuration provider?

Community
  • 1
  • 1
Sam Holder
  • 32,535
  • 13
  • 101
  • 181

1 Answers1

0

So we solved this by wiring up a handler to the AppDomain.CurrentDomain.AssemblyResolve event and loading the assembly manually.

It's still not clear to me why our resolver is being triggered but the dll can't be found, but it seems to work.

Sam Holder
  • 32,535
  • 13
  • 101
  • 181