Using .Net (CLR Managed) Classes in IIS6
|how-to | home|
Like other win32 programs, IIS-based unmanaged (ASP or ISAPI) application can use classes from CLR (.Net) assemblies by referencing them through <clrClass> manifest element. You may wish to read the introduction to using CLR classes in win32 manifests before proceeding further.
While searching for win32 manifests in IIS-based applications is quite well thought out, as of Windows Server 2003 searching for CLR assemblies is deficient. The problem is that, unlike win32 manifest search, CLR class search uses the executable program's directory as the base of the search. Generally all web applications run in the context of the same executable - w3wp.exe - so all CLR assembly searching starts in C:\Windows\System32\inetsrv. This precludes isolating CLR assemblies by putting them in the web application folder. Microsoft is aware of this and we may see a change in the future.
Until then there are some workarounds that can be used:
|(web application directory)||.DLL|
|(web application directory)||.MANIFEST|
|(web application directory)\(assembly directory)||.DLL|
|(web application directory)\(assembly directory)||.MANIFEST|
The web application directory is the location of your web manifest (something like C:\inetpub\wwwroot\application.)
For more details on assembly search sequence read Assembly Searching Sequence on MSDN...
Note that there is no attempt to access the web application's directory while searching (probing) for the CLR assembly.
See also Modifying .Net Assembly Search Order
Standalone applications Using CLR managed classes in unmanaged win32 applications