Copy DLL from GAC.

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.