Core code
using System.Reflection; using System.Runtime.InteropServices; // 有关程序集的常规信息通过下列特性集 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("MusicStore")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("MusicStore")] [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 会使此程序集中的类型 // 对 COM 组件不可见。如果需要 // 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID [assembly: Guid("a9ef3281-9049-4a52-a2f1-2061d442200e")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 内部版本号 // 修订版本 // // 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值, // 方法是按如下所示使用 "*": [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]E I. Global attributes Most characteristics are suitable for specific language elements (such as class or methods), but some attributes are global they are applicable. to the entire assembly or module. For example: AssemblyVersionAttribute attribute can be used to embed version information into an assembly. Global attributes appear in source code before any top-level using directives and before any type, module or namespace declarations. Global attributes can appear in multiple source files, however, the files must be compiled in a single compile pass. In C# projects, they are in the AssemblyInfo.cs file. Assembly attributes are values that provide information about the assembly. They are divided into the following categories: ①Assembly identification characteristics ②Informational characteristics ③Assembly manifest characteristics ④Strong name characteristics 1. Assembly identification characteristics Three characteristics (use strong names , if applicable) Determine the assembly's identity: name, version, and culture. When referenced in code, these attributes form the full name of the assembly required. Using attributes, you can set the version and culture of an assembly. However, the name value is set by the compiler, in the Assembly Information dialog box of the Visual Studio IDE, after the assembly is created, according to the file that contains the assembly manifest. The AssemblyFlagsAttribute attribute specifies whether multiple copies of an assembly can coexist.
/// <summary> /// 旧类 /// </summary> [Obsolete("请使用 " + nameof(NewClass))] class OldClass { public void Method() { } } /// <summary> /// 新类 /// </summary> class NewClass { [Obsolete("请使用 " + nameof(NewMethod), true)] public void OldMethod() { } public void NewMethod() { } }rrree
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article
What's New in Windows 11 KB5054979 & How to Fix Update Issues
4 weeks agoByDDD
How to fix KB5055523 fails to install in Windows 11?
3 weeks agoByDDD
InZoi: How To Apply To School And University
1 months agoByDDD
How to fix KB5055518 fails to install in Windows 10?
3 weeks agoByDDD
Where to find the Site Office Key in Atomfall
4 weeks agoByDDD

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

Dreamweaver CS6
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

WebStorm Mac version
Useful JavaScript development tools
