开发者

Are there any similarities between a COM DLL and a .NET DLL other than the extension?

I've only started to learn programing recently in the past couple years, and all of it has been in C#.NET. I know DLL files existed before .NET so what I'd like to know is if there is any similarity between the .NET DLL files I create now and the COM DLL files that existed before? In other words if I were to take a .NET DLL I created today back in time before .NET and give it to a COM developer would they be able to derive any information from the file? Or would it just look like a gibberish file with an extension they are familiar with?


Update

Thanks for the responses so far. Now what about EXE files? Are there any simi开发者_运维百科larities between a .NET EXE and a COM EXE? Would a computer with out .NET installed even be able to find the entry point for a .NET exe or would it simply think the file is corrupt or invalid?


The similarity, and hence the reuse of the same extension, is that they are functionally equivalent. That is, they are both class libraries that contain potentially shared methods and classes.

However, unless the .NET dll is COM-visible, then no, a COM developer would not be able to any useful information from them.

EDIT:

Per your update, a machine without .Net installed (or even one without the required version of the .Net framework), would be able to find the entry point for the application, but it would fail with an exception quickly (that is, before it really does anything).


There is no correspondence whatsoever. A .NET assembly is a data file, it contains 5 bytes of machine code. The rest is metadata and IL. Gibberish enough without the tools to decompile it, like ildasm.exe or Reflector.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜