Interoperability of .NET components and COM components

xiaoxiao2021-03-05  28

The difference between .NET components and COM components

The .NET component can be divided into two categories: shared .NET components and private .NET components. Shared .NET components need to ensure their own uniqueness through standard public keyword technology, which is more similar to the world's unique ID number GUID similar to COM. However, we should try to avoid the use of shared .NET components in the case of possible, because it will be able to fall into the "DLL Hell" that is currently in the long-term developer under the window system. Private .NET components are the way we will use frequently. Net component, in this way, we will release .NET components need to do simple copy operation, as if returned to ancient Dos era. It is not necessary to care about the complex system registry, and don't have to worry about the problem of the DLL version covered. The COM component is Microsoft once has also pushed a lot of code multiplexed technology frameworks, which also has achieved great development and application in these years, but its drawbacks are also increasingly obvious, we have to face many The version control between COM components and the horrible DLL hell, as well as registry, guid, and more. While we install a software, we also bring a lot of weighing COM components we are unknown to our operating system. However, the technical advantage of the COM component is also obvious. In a large extent, the code multiplexed under the Windows platform is realized, so we will propose such a topic, how to protect the .NET technology to be mature, And use a large number of software and products that have existing COM technology?

.NET components

Create a "class library" project

Class1.cs change to main.cs

Do not use Namespace

转载请注明原文地址:https://www.9cbs.com/read-34384.html

New Post(0)