Custom Attribute Technology Sample
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
This sample demonstrates how to create a .NET Framework custom attribute and associate that attribute with a type or member. The sample also demonstrates how to use the types in the System.Reflection namespace to determine whether a type or member has a custom attribute associated with it.
For information about using the samples, see the following topics:
To build the sample using the command prompt
Open a Command Prompt window and navigate to one of the language-specific subdirectories for the sample.
Type msbuild CustomAttributeCS.sln or msbuild CustomAttributeVB.sln, depending on your choice of programming language.
To build the sample using Visual Studio
Open Windows Explorer and navigate to one of the language-specific subdirectories for the sample.
Double-click the icon for CustomAttributeCS.sln or CustomAttributeVB.sln, depending on your choice of programming language, to open the file in Visual Studio.
On the Build menu, click Build Solution.
To run the sample
Navigate to the directory that contains the built executable, using the command prompt.
The sample uses the following technologies and classes:
For more information about creating custom attributes, see the comments in the source code files.