Share via


IncrementalGeneratorPostInitializationContext.AddEmbeddedAttributeDefinition Method

Definition

Adds a SourceText to the compilation containing the definition of Microsoft.CodeAnalysis.EmbeddedAttribute. The source will have a hintName of Microsoft.CodeAnalysis.EmbeddedAttribute.

public void AddEmbeddedAttributeDefinition();
member this.AddEmbeddedAttributeDefinition : unit -> unit
Public Sub AddEmbeddedAttributeDefinition ()

Remarks

This attribute can be used to mark a type as being only visible to the current assembly. Most commonly, any types provided during this IncrementalGeneratorPostInitializationContext should be marked with this attribute to prevent them from being used by other assemblies. The attribute will prevent any downstream assemblies from consuming the type.

Applies to