rspec/rules/S4428/description.adoc
2023-07-04 13:39:40 +02:00

7 lines
828 B
Plaintext

== Why is this an issue?
To customize the default behavior for an export in the https://learn.microsoft.com/en-us/dotnet/framework/mef/[Managed Extensibility Framework] (MEF), applying the https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute[`PartCreationPolicyAttribute`] is necessary.
For the https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.partcreationpolicyattribute[`PartCreationPolicyAttribute`] to be meaningful in the context of an export, it is required to also annotate the class with the https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.composition.exportattribute[`ExportAttribute`].
This rule raises an issue when a class is annotated with the `PartCreationPolicyAttribute` but not with the `ExportAttribute`.