ProvideCodeGeneratorAttribute Class
Apply this attribute to the package class in a Visual Studio extension that provides a custom tool.
Assembly: Microsoft.VisualStudio.TextTemplating.VSHost.12.0 (in Microsoft.VisualStudio.TextTemplating.VSHost.12.0.dll)
System::Attribute
Microsoft.VisualStudio.Shell::RegistrationAttribute
Microsoft.VisualStudio.TextTemplating.VSHost::ProvideCodeGeneratorAttribute
| Name | Description | |
|---|---|---|
![]() | Description | A human readable description of this generator |
![]() | GeneratesDesignTimeSource | If true, this code generator provides design-time source code |
![]() | Name | The name of this generator. To apply this generator to a file in Solution Explorer, set its Custom Tool property to this name. |
![]() | ProjectSystem | The project system with which this code generator is registered. |
![]() | RegisterCodeBase | If true, the generator is registered using a codebase - that is, a specific assembly file location. If false, the assembly is in the GAC. |
![]() | Type | The type implementing the Code Generator |
![]() | TypeId | (Inherited from RegistrationAttribute.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | (Inherited from Attribute.) |
![]() | GetHashCode() | (Inherited from Attribute.) |
![]() | GetType() | (Inherited from Object.) |
![]() | IsDefaultAttribute() | (Inherited from Attribute.) |
![]() | Match(Object^) | (Inherited from Attribute.) |
![]() | Register(RegistrationAttribute::RegistrationContext^) | |
![]() | ToString() | (Inherited from Object.) |
![]() | Unregister(RegistrationAttribute::RegistrationContext^) |
| Name | Description | |
|---|---|---|
![]() ![]() | AspNetProjectGuid | Guid of the ASP.Net Project System package |
![]() ![]() | CSharpProjectGuid | Guid of the C# Project System package |
![]() ![]() | VisualBasicProjectGuid | Guid of the Visual Basic Project System package |
| Name | Description | |
|---|---|---|
![]() ![]() | _Attribute::GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfo(UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfoCount(UInt32) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) | (Inherited from Attribute.) |
This attribute registers your Visual Studio extension as a custom tool. When a user has installed an extension that has this attribute, they can use it to generate files using the Run Custom Tool command in Solution Explorer.
This attribute performs automatically the registration task that is described in Registering Single File Generators.
Apply the attribute to the package class (not the generator class).
See also ProvideCodeGeneratorExtensionAttribute.
[ProvideCodeGenerator(typeof(MyGenerator), "MyCustomTool", "My custom tool", true, ProjectSystem = ProvideCodeGeneratorAttribute.CSharpProjectGuid)]
internal sealed partial class MyPackage : Microsoft.VisualStudio.Shell
.Package
{ ... }
internal class MyGenerator : Microsoft.VisualStudio.Shell.Interop.IVsSingleFileGenerator
{ ... }
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.





