These days I am working on some basic research on Microsoft Office HTML viewer. the Microsoft Office HTML viewer is a HTML viewer for displaying office documents in an HTML format. if you don't know what can the Microsoft Office HTML viewer do for you, click here for details on Microsoft.
I want to a user of our application can view a document from a document library without having an application capable of displaying the requested document installed on the client computer. you know, Microsoft Windows SharePoint Services provides
Microsoft. htmltrans. Interface Namespace to do this. So I create a web project to test its function, I want to use some Members in
Microsoft. htmltrans. Interface Namespace within my sample project.
First of all, I must declare the namespace. To do this I need to make references to
Microsoft. htmltrans. interface. dll Assembly, but it is not in the list of references in vs.net. then I look in the GAC and yes, the Assembly is regedited In the GAC, but how to make a reference directly from GAC? Seems to impossible. So I think it is physically stored in some place of my disk. But after a search on my complete disk, the result is nothing.
It seems to be much troubled, but I still believe that it is physically stored in some folder. So I decided to use reflection to get its information, here is the code:
1 Assembly massembly;2 String Typeinfo = "Microsoft. htmltrans. Interface, version = 11.0.0.0 ," 3 + "Culture = neutral, publickeytoken = 71e9bce111e9429c" ; 4 Massembly = assembly. Load (typeinfo );5 MessageBox. Show (massembly. codebase );
OK, its codebase attribute is "C:/Windows/ASSEMBLY/GAC/microsoft.html Trans. Interface/
11.0.0.0 _ 71e9bce111e9429c/microsoft.html Trans. interface. dll ", so I go to the following folder:
C: \ windows \ Assembly \ GAC \ microsoft.html trans. Interface \ 11.0.0.0 _ 71e9bce111e9429c \
But the operating system told you that the directory is not exist, don't worry, you can copy it in DOS mode.
Now copy this DLL into a local folder in DOS mode and reference the DLL from there in vs. net.
That's all about it, but I wonder why they do not leave this DLL in a physically folder where we can easily find it?