Wednesday, 3 October 2012

In VisualStudio - quickly adding a Menu and hooking the build process

The VisualStudio Extension and EnvDTE APIs are really hard to get into (and there are number of gotchas like the need to pin the events objects or they will stop working).

To make life easier (and more productive) the O2 VisualStudio FluentAPI tries to abstract all that complexity into easy to use and fast ExtensionMethods.

For example here is a script that shows how to add a menu item and hook  the build process:

You can execute that script in real-time using the VisualStudio C# REPL Extension , or by using the FluentSharp - VisualStudio2010 NuGet package on your project.

The source code is all on GitHub and for reference here are the Extension APIs on a number of VisualStudio Extension Objects (like EnvDTE)