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:
| Directory | Extension |
|---|---|
| C:\Windows\WinSxS\manifests\ | .manifest |
| C:\Windows\assembly\GAC\ | .DLL |
| (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...
| Directory | Extension |
|---|---|
| C:\Windows\assembly\GAC\ | .DLL |
| C:\Windows\System32\inetsrv | .DLL |
| C:\Windows\System32\inetsrv\(assembly directory) | .DLL |
| C:\Windows\System32\inetsrv | .EXE |
| C:\Windows\System32\inetsrv\(assembly directory) | .EXE |
Note that there is no attempt to access the web application's directory while searching (probing) for the CLR assembly.