Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Package.RegisterProjectFactory Method

Registers a project factory with Visual Studio.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

protected void RegisterProjectFactory(
	IVsProjectFactory factory


Type: Microsoft.VisualStudio.Shell.Interop.IVsProjectFactory
The project factory to register.


factory is null.

The RegisterProjectFactory method registers the given project factory with Visual Studio. To register a project factory for a package, perform the following steps:

  1. Add a ProvideProjectFactoryAttribute to your package class.

  2. Override the Initialize method. Call RegisterProjectFactory in this method and pass the instance of your project factory. Be sure to call the base class Initialize method.

Unregistration of project factories automatically happens when the package is disposed. If the project factory object implements IDisposable, its Dispose method is called after the factory has been unregistered with Visual Studio.

Community Additions

© 2015 Microsoft