.NET Framework Bookmark and Share   
 index > .NET Base Class Library > Reference file in the registry
 

Reference file in the registry

In Windows, COM classes, interfaces and type libraries are listed by GUIDs in the registry.

So how about .net dll files?

If so, how to check it? For example, there is a class library file test.dll.

How can I check it in the registry?


Thanks
ardmore
.NET DLL files aren't listed in the registry. They don't have to be registered like the COM interfaces and type libraries, therefore, you won't find them in the registry. If they exist on the disk, they exist.
Coding Light - Illuminated Ideas and Algorithms in Software
Coding Light Wiki �LinkedIn �ForumsBrowser
David M Morton
Okay. So can you please tell me how to check COM interfaces and type libraries in the registry?
ardmore
This sounds like a different question. Your original question is "how to check .NET assemblies in the registry". The answer to your original question is: "You don't".

I haven't had alot of experience with COM, but from what I understand, checking COM interfaces and their existence in the registry describes the problem known as "DLL He!!" pretty well.

I believe most of these classes, by GUID can be found at the following couple of registry locations:

HKCR\Interface and HKCR\TypeLib

Again, your original question was about .NET, not COM.

Coding Light - Illuminated Ideas and Algorithms in Software
Coding Light Wiki �LinkedIn �ForumsBrowser
David M Morton
Hello ardmore

Are you exposing .NET components to COM?
http://msdn.microsoft.com/en-us/library/zsfww439.aspx

If yes:

You should get a .tlb file accompanied with the .dll assembly. If you do not see the .tlb file, please run this command upon the .dll file:

tlbexp yourassembly.dll /out:outfile.tlb

After you get the tlb file, please open it using oleview. oleview is available in Windows SDK. You will see "coclass" in the viewer. They are the COM classes exported from your .NET component. By clicking on the coclass in oleview, you will see something like this:

[
uuid(18DF081C-E8AD-4283-A596-FA578C2EBDC3),
helpstring("AcroIEHelperShimObj Class")
]
coclass AcroIEHelperShimObj {
[default] interface IAcroIEHelperShimObj;
};

The GUID in uuid is the CLSID of the COM class. Next, you can navigate to the registry key of the COM class:

HKCR\CLSID\{18DF081C-E8AD-4283-A596-FA578C2EBDC3}



If no:

As David said, the dll is in your file system or GAC. It is not registered in the registry.


If you have any other questions, please feel free to post here.

Regards,
Jialiang Ge

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Jialiang Ge [MSFT]
Thanks Ge,

I heard that regasm can be used to export an assembly to a typed library as well.
So what is the difference between "regasm" and "tlbexp" tools?
I mean in which circumstance a tool is selected?
ardmore
Hello ardmore

regasm is used to register a .NET assembly into registry. After the registration, it can be used as a COM.
tlbexp is used to export tlb (type library) from a .NET assembly. It does not register the assembly.

Here are some reference materials about the two tools:
http://msdn.microsoft.com/en-us/library/tzat5yw6.aspx
http://msdn.microsoft.com/en-us/library/hfzzah2c.aspx
http://www.codeproject.com/KB/vb/Tlbexp_and_Regasm.aspx

If you have any other questions, please feel free to tell me.

Regards,
Jialiang Ge

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Jialiang Ge [MSFT]

You can use google to search for other answers

Custom Search

More Threads

• Difference between C# and C++.NET
• VB 2005 Colletions Issue
• FAQ: How do I create an instance of a type if I only know its name?
• Reflection: Add new method to existing type
• FileStream for a non-file device
• Re: How to acess Controls of Master page in Content page in asp.net 2005 using javascript
• Deploying the .NET Framework with an application
• How about a form topic "Getting Started"?
• using instruction question
• Reflection and Plugins