.Net, ASP.Net, C#, VB.net, SQL Server, Xml, CSS, Design Patterns related tips, tricks, code snippets, articles, links, thoughts, etc. from Binu & Subi Thayamkery.

Binu Thayamkery is a seasoned software architect with more than 13 years of experience in developing enterprise grade connected systems using Microsoft Technologies. In his current position as a lead consultant-solution architect with Prudential Financial, he is working on architecture of next generation investment reporting framework using .net 3.5/WCF/AJAX, etc. He holds a Masters Degree in Computer Science from Colorado State University. Subi Thayamkery is an experienced software developer with more than 8 years of developing various application software systems ranging from workflow automation systems to compliance management tools. She currently works as a technology consultant for Prudential Financial where she helps develop a new system for corportate governance department. She holds an Electrical Engineering degree from New Jersey Institute of Technology.

Wednesday, February 15, 2006

.Net Framework Tools Part 2

Type Library Importer (TlbImp.exe) and Exporter (TlbExp.exe)
Type library importer imports the type library information for a COM components into equivalent definitions in command language runtime library. This is useful when you want to use your legacy COM components with your new .Net application (think COM Interop). If you are someone like me who uses Visual Studio.Net, you can do this by adding a reference to the COM components from your IDE. For others, sample usage is:

tlbimp myTLB.tlb /out:myNet.dll

For more information on this tool goto: http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfTypeLibraryImporterTlbimpexe.asp

Type library exporter is opposite of importer, it is useful to create a type library for your .netr assembly. Again this is used in a COM interop scenario when your COM application (ex: your old VB 6.0 App) wants to use some new functionality that your developed using .Net ( I see this in lot of places where critical VB 6.0 apps still being used and new development moved to .net and this approach is usually part of the migration strategy)

Usage is:


tlbexp myNet.dll /out:myTLB.tlb

One important information to note here is that this tool creates the TLB but does not register it. For that you should use another tool (discussed next) , RegAsm.exe
For more information on this tool goto: http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfTypeLibraryExporterTlbExpexe.asp

Assembly Registration Tool (RegAsm.exe)
This tool reads the metadata within the .net assembly and creates the necessary information within the registery so that a COM client can consume services of a .Net component. This tool can optionaly create a TLB also. Afer you register your assembly using this tool, you can install it into Global Assembly Cache also so that it can be activated from any client. How do we do it? Use GacUtil.exe which will be discussed next :)

Usage for RegAsm.exe:

regasm myNet.dll
or when you want to create a TLB, use
regasm myNet.dll /tlb:myTLB.tlb

For more information on this tool goto: http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfAssemblyRegistrationToolRegasmexe.asp

Global Assembly Cache Tool (GacUtil.exe)
This tool is used to view and manipulate the contents of the Global Assembly Cache. Like we explained earlier, one use is to install new .net assembly into GAC. This can also be used to uninstall an assembly. Examples of simple usages are:

For install
gacutil /i myNet.dll


For uninstall
gacutil /u myNet.dll


For more information on the tool and its usage goto:http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfGlobalAssemblyCacheUtilityGacutilexe.asp

0 comments: