http://blogs.clariusconsulting.net/pga

Pablo Galiano's Blog

Go Back to
pga′s Latest post

MEF VSIX Project template

I have just uploaded a new Visual Studio extension to the Visual Studio Gallery

It is basically a new project template to create MEF based Visual Studio extensions (VSIX)

The differences between this project template and the one that comes with the VS SDK are:

  • Assembly references
    • System.ComponentModel.Composition.dll
    • Microsoft.VisualStudio.ExtensibilityHosting.dll
  • A MyExport class in created
  • public interface IMyExport
    {
    }

    [Export(typeof(IMyExport))]
    public class MyExport : IMyExport
    {
    }

  • The AssemblyInfo contains the VsCatalogName attribute

//TODO: Specify the catalog name for the exported objects
[assembly: VsCatalogName("Foo")]

  • The extension manifest contains the MEFComponent content type

<Content>
  <MEFComponent>MEFVSIXProject3</MEFComponent>
</Content>

After you install it, it is displayed under the Visual C# category

image

You can also discover it by browsing the Online Templates tab in the new Add New Project dialog:

image

 

Enjoy,

Pablo

Comments

1 Comment

  1. Thanks a lot for this, helped me to go to the right direction