-
Notifications
You must be signed in to change notification settings - Fork 0
AssemblyAttributes
wwwDayDream edited this page May 9, 2024
·
4 revisions
C# Attributes can also be applied to your assembly (what?!) and there are some specific limitations.
- Assembly attributes must be outside of any namespace declarations.
- Assembly attributes must explicitly state they are applying to the assembly with a preceeding tag
assembly:
inside the attribute brackets.
Examples can be seen below:
using System;
using CessilCellsCeaChells.CeaChore;
namespace MyTestMod {
[assembly: RequiresField(...)]
}
using System;
using CessilCellsCeaChells.CeaChore;
[assembly: RequiresField(...)]
Now you can add any of the following attributes:
- [assembly: RequiresField(...)]
- [assembly: RequiresProperty(...)]
- [assembly: RequiresMethod(...)]
- [assembly: RequiresMethodDefaults(...)]
- [assembly: RequiresEnumInsertion(...)]
Additionally, you can use the MSBuild tool to gain compile-time references to newly created members (except Enums).