asp.net dll registered as COM detail procedure

Source: Internet
Author: User

1, in the development environment, in the vs.net2003 or 2005 of the IDE environment can implement the automatic registration of COM components, set as follows: Project name-> "Properties"-> Configuration Properties-> build-> Select "Register for COM Interop," Compile.

2, with a strong name of the way

(1), create Strong name

Sn–k mycom.snk

and copy the strong name to the engineering directory.

Modify the corresponding configuration in Assembyinfo.cs

[Assembly:assemblykeyfile (@ "Http://www.cnblogs.com/mycom.snk")]

[Assembly:comvisible (True)]

(2), Registered Accessories

RegAsm Mycom.dll/tlb:mycom.tlb

(3), will install accessories into the GAC

Gacutil-i Mycom.dll

3, without the strong name of the way

RegAsm Mycom.dll/tlb:mycom.tlb/codebase

Note the use of codebase, if you want to register a. NET assembly without a strong name, then use the RegAsm registration will be added/codebase, which is to set the basic code in the registry, that is, record the path of the DLL.

After registration, create objects and use the same method as above:

Set mydll = Server.CreateObject ("Mycom.object")

Mydll.method

If you call the encryption decryption tool in OA4, the ASP tutorial code is as follows:

<%

Dim Objencrytool

Dim strtemp

Set objencrytool = Server.CreateObject ("Routdata.devbase.basetools.encrytool")

strtemp = "Abc-jian"

Response.Write strtemp & "<br>"

strtemp = Objencrytool.en (strtemp)

Response.Write strtemp & "<br>"

strtemp = objencrytool.de (strtemp)

Response.Write strtemp & "<br>"

Set Objencrytool = Nothing

%>

Note that the class method to be published cannot be static

Assembly Registration Tool (Regasm.exe)

Http://msdn.microsoft.com/library/chs/default.asp?url=/library/chs/cptools/html/cpgrfassemblyregistrationtoolregasmexe.asp

Strong Name Tool (Sn.exe)

Http://msdn.microsoft.com/library/chs/default.asp?url=/library/chs/cptools/html/cpgrfassemblyregistrationtoolregasmexe.asp

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.