Tag Archives: Assembly Resolve

Platform specific assembly resolve

Some time ago I had a situation where I needed to include a dependency within one of my web projects for which there existed only platform specific DLLs (x86 or x64, no AnyCPU version). The project itself was built and deployed as AnyCPU, and I had no intention of changing to platform specific 32bit and 64bit versions.

By attaching to the AppDomain.AssemblyResolve event, it is possible to provide your own method for locating and loading code to satisfy a given dependency. In this example the need was to substitute different platform specific copies of the same assembly depending on whether the process was launched in a 32 bit or 64 bit environment. However there is the opportunity to perform more complex implementations such as loading an assembly from a byte array or generating a dynamic assembly.
Continue reading Platform specific assembly resolve