In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to use C# metadata for you. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
C # metadata
Although metadata is used to describe and reference types defined by the VOS type system, it cannot be locked to this single target. When you write a program, the types you declare (assuming they are numeric or reference types) are introduced to the NGWS runtime type system by using type declarations. The type declaration is described in the metadata stored inside the PE executable.
Basically, C # metadata is used for tasks such as locating and loading classes, cases of those classes in memory, resolving calls, translating IL to source code, strengthening security, and setting runtime context boundaries.
You don't have to worry about the generation of C# metadata. The metadata is generated by C# 's Code to IL Compiler (code-to-IL compiler, not the JIT compiler). The code goes to the IL compiler to send binary metadata information to the PE file, which is sent in a standard way, unlike the C++ compiler, which creates their own decorated names for export functions.
The main advantage you get from the coexistence of C # metadata and executable code is that the information about the type is fixed with the type itself and will not be distributed in many places. It also helps to solve version problems that exist in COM. Further, you can use different version libraries in the same context, because the library is referenced not only by the registry but also by the metadata contained in the executable code.
Universal language specification
The Common language Specification (CLS) is not really part of the Virtual object system (VOS), it is special. CLS defines a subset of types in VOS, as well as general usage that must conform to CLS.
So what's the confusion about this? If one class library follows the CLS rules, and other programming languages follow the CLS rules, then customers of other programming languages can also use the class library. CLS is about the interactive operability of languages (interoperability). Therefore, general usage must follow only externally accessible items (externally visible items) such as methods, properties, events, and so on.
The advantage I have described is that you can do the following work. Write a component in C # and derive it in VB, because the functionality added to VB is so powerful that it is derived again from the VB class in C #. This is feasible as long as all externally accessible items follow CLS rules.
The code I show in this book doesn't care about the CLS protocol. But be aware of the CLS protocol when building your class library. I provide Table 2.1 for types and externalities
This is the end of the article on "how to use C# metadata". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.