Coolthing Of Theday

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 28 October 2013

Clide, your guide to Visual Studio Extensibility sanity...

Posted on 17:52 by Unknown

Daniel Cazzulino's Blog - High level overview of Visual Studio Extensibility APIs

If your head is dizzy with the myriad VS services and APIs, from EnvDTE to Shell.Interop, this should clarify a couple things.

First a bit of background:

APIs on EnvDTE (DTE for short, since that’s the entry point service you request from the environment) was originally an API intended to be used by macros. It’s also called the automation API. Most of the time, this is a simplified API that is easier to work with, but which doesn’t expose 100% of what VS is capable of doing. It’s also kind of the “rookie” way of doing VS extensibility (VSX for short), since most hardcore VSX devs sooner or later realize that they need to make the leap to the “serious” APIs.

The “real” VSX APIs virtually always start with IVs, make heavy use of uint, ref/out parameters and HResults. These are the APIs that have been evolving for years and years, and there is a lot of COM baggage. IVsHierarchy is a pretty representative example. But there’s hope, since most of the newer capabilities of the IDE are exposed with much more modern and .NET-friendly APIs, such as IVsExtensionManager.

Solution Traversal

Solution traversal is such a core activity for any VS extension that you almost always need to do it sooner or later. As you probably guessed, there are two main ways: DTE/Automation way, and the IVs* way.

One key thing to understand is that the automation API is an *optional* API that project types can decide to support. There’s no guarantee that any part of the automation APIs will work for a particular project. This is what may cause an extension to fail for example in a solution with a VC++ project and not with “regular” C#/VB projects.

I’d always go for the IVs* way always, since it’s more reliable, and works with projects that may not expose automation API for their custom project types. You can always get at the information the DTE API exposes by using the IVs* APIs, but it’s generally quite a bit more work.

Too Painful?

Alternatively, you can take advantage of Clide, a more intuitive and .NET friendly API, which leverages Linq, extension methods, dependency injection for testability, etc.

...

clariuslabs / clide

What is Clide?

Provides a managed, intuitive, modern and composable API for Visual Studio extensibility and automation. It leverages dependency injection in Visual Studio, supports unit testing of automation and extensibility code, and provides useful primitives for both consuming VS services and tools as well as providing your own.

How do I get it?

Install from https://nuget.org/packages/Clide

How can Clide help me?

If you are authoring any kind of Visual Studio tooling or automation (either from a VSIX or from a NuGet PowerShell script), Clide can make things easier, by providing an intuitive API for the solution, tool windows, option pages, etc.

...

Clide: An Enjoyable Visual Studio Automation API

High-level, composable and testable APIs for working with Visual Studio.

Release Notes

v2.1
* Added FindProjects extension method for ISolutionNode, which is more efficient than traversing the entire solution.
* Improved support for side-by-side versioning of Clide assemblies deployed by multiple extensions

v2.0
* Reworked internals to avoid depending on VS-MEF extensibility, which is problematic and may cause interference with VS composition.
* Core DI now provided by Autofac, which gives us a performance boost in addition.
* Components now don't need any [Import] or [ImportingConstructor] in order for constructor dependencies to work, even for core VS services like IServiceProvider or IVsShell, DTE, etc.
* Types that have the ComponentAttribute applied are automatically registered.
* Supports registering with a certain type (like [Export(typeof(IMyService))]): [Component(typeof(IMyService))]
* Added support for registering components as single instance (singletons) using [Component(IsSingleton = true)]

...

I've seen VS extensibility and automation in a number of projects I've highlighted over the years and it always kinds of makes my brain hurt. Now seeing this, I wonder if this is the VS Extensibility aspirin I've long been looking for?

Oh yeah and I love that this open source. :)

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in .Net, Development, VisualStudio | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Mr. 7,000! This is my 7,000th post...
    Before this post; After; 20 visits between taking these snaps? Oh wait, that's probably me searching for past related posts....
  • "Windows Server Essentials Media Pack" (DNLA Stream, HTML5 and Dashboard Media stuff)
    Microsoft Downloads - Windows Server Essentials Media Pack This pack enables the media streaming functionality for Windows Server 2012...
  • Rad Gate Post... Get your Red Gate Post here...
    simple talk - Melanie Townsend - Get a copy of the Red Gate Post We recently put together a newspaper of some of the best articles fr...
  • Windows Management Framework 4.0 (PowerShell 4, PowerShell ISE, Management OData, WMI, etc.) now available
    Keith Hill's Blog - PowerShell 4.0 Now Available You can get PowerShell 4.0 for down level operating systems now via the WMF 4.0 d...
  • Viasfora - Your new favorite Visual Studio Text/*ML Editing Extension?
    Winterdom - Introducing Viasfora A couple of days ago, I unveiled Viasfora , my latest attempt at building a decently packaged extensi...
  • "Windows Server [2012 R2]: The Best Infrastructure to Run Linux Workloads"
    In the Cloud - What’s New in 2012 R2: Enabling Open Source Software Part 4 of a 9-part series . ... There are a lot of great s...
  • [Hardware Review] Life with Haswell... Haswell/Harris Beach Intel SDS Ultrabook Review - Part 2
    "So Greg, how's life with Haswell been?" "Pretty Sweet! (Mostly)" I've been given an opportunity to review t...
  • Fuzzy Lookup Add-In for Excel (Insert lame "Fuzzy, wuzzy was an Excel..." snip here)
    Microsoft Downloads - Fuzzy Lookup Add-In for Excel The Fuzzy Lookup Add-In for Excel performs fuzzy matching of textual data in Exce...
  • Caliburn.Micro v1.5.0 released (CM gets Tasks, Async/Await and Share/Setting for RT... and bug fixes of course)
    Caliburn.Micro - Caliburn.Micro v1.5.0 "Release Notes This release fixes many bugs. It also adds support for Task and async/a...
  • Just about everything you ever wanted to know about SQL Server Date and Time Data Types...
    CodeProject - Date and Time Data Types and Functions - SQL Server (2000, 2005, 2008, 2008 R2, 2012) Introduction It would be bette...

Categories

  • .Net
  • 3DPrinting
  • AFeedYouShouldRead
  • Agile
  • ALM
  • Amazon
  • Amiga
  • Analytics
  • Android
  • ASP.NET
  • Azure
  • BigData
  • bing
  • Blogging
  • Book
  • BookReview
  • BUILD
  • C
  • C#
  • C++
  • Career
  • Cat
  • cheatsheet
  • ClickOnce
  • Cloud
  • ComputerHardware
  • css
  • Data
  • DBA
  • DependencyInjection
  • Deployment
  • Design
  • Development
  • devops
  • DVCS
  • ebook
  • EDD
  • Education
  • EnterpriseLibrary
  • EntityFramework
  • Exchange
  • Expression
  • gadget
  • Game
  • GIT
  • Google
  • Government
  • Hadoop
  • hardware
  • HardwareReview
  • HaswellReview
  • HTML5
  • Humor
  • IE
  • IEExtension
  • IfAllElseFails
  • IIS
  • ILMerge
  • Image
  • Infographic
  • interview
  • InversionOfControl
  • Java
  • Javascript
  • Kinect
  • LightSwitch
  • LINQ
  • Linux
  • LosAngeles
  • Lucene
  • Lync
  • MEF
  • Metro
  • MicrosoftOffice
  • MicrosoftOutlook
  • Mono
  • MVC
  • MVVM
  • NetMon
  • NLP
  • NoSQL
  • NuGet
  • OData
  • OneNote
  • OpenXML
  • Paint.Net
  • Personal
  • Photosynth
  • Physics
  • portable
  • Poster
  • PowerShell
  • Preparedness
  • Presentation
  • Prism
  • PrivateCloud
  • RegEx
  • RemoteDesktop
  • Reporting
  • RIAServices
  • Science
  • ScienceFiction
  • Scratch
  • Scrum
  • ServiceBus
  • SharePoint
  • Silverlight
  • SimiValley
  • SPA
  • Space
  • SQLServer
  • Storyboard
  • Surface
  • SVG
  • SystemAdministration
  • T4
  • TeamBuild
  • TeamFoundationServer
  • TechEd
  • Training
  • TypeScript
  • UnitTesting
  • UnityApplicationBlock
  • Utility
  • Veteran
  • VirtualMachine
  • Visio
  • VisualBasic
  • VisualStudio
  • WCF
  • Web X.X
  • Webcast
  • WebFeed
  • WebMatrix
  • Windows
  • Windows7
  • Windows8
  • Windows8.1
  • WindowsHomeServer
  • WindowsLiveWriter
  • WindowsPhone
  • WindowsServer
  • WinRT
  • WiX
  • WMI
  • WOPI
  • WPF
  • XAML
  • XBox360
  • XboxOne
  • zombie

Blog Archive

  • ▼  2013 (500)
    • ►  December (12)
    • ►  November (61)
    • ▼  October (65)
      • WindowSMART (The HD/SSD health monitoring, reporti...
      • 11 for 12... 11 Free SQL Server 2012 Microsoft Vir...
      • TechBooks, your Windows 8.1 window to discovering,...
      • "Halloween Costumes for Programmers" Comic
      • “Ship it, Maybe” - Yammer's software shipping parody
      • Mr. 7,000! This is my 7,000th post...
      • Welcome OctoGit... I mean, Octokit.Net for GitHub
      • Mastering MDS with the Master Data Services Operat...
      • Windows Azure Guidance - Cloud Design Patterns Alp...
      • "We're from the Government and we're to help with ...
      • Zombie Post of the Day #2: Zombie Combat Battalion...
      • Zombie Post of the Day #1: "Cloudy with a chance o...
      • Hotfix released to remove 'SecureBoot isn't config...
      • Clide, your guide to Visual Studio Extensibility s...
      • Toward Metadata Mastery with the Windows API Code ...
      • "Theory and Applications for Advanced Text Mining"...
      • Seven for SQL... Seven Free eBooks from Pinal Dave...
      • Surface RT Battery draining faster than you're use...
      • Internet Archive's Historical Software Archive = R...
      • Jesse's got your number (of Insanely Essential Pro...
      • Windows Management Framework 4.0 (PowerShell 4, Po...
      • Wriju's TFS 2013 Book and Video Link Round-up
      • XPlatformCloudKit - Your Cross Windows Phone, Wind...
      • Jason's Spa (err... I mean, Jason Haley's new SPA,...
      • Doughnuts! (Well, Infragistics XAML Doughnut Chart...
      • Doughnuts! (Well, Infragistics XAML Doughnut Chart...
      • Only for the cool cats (SQL Cat's are cool be defi...
      • Free eBook of the Day: "45 Database Performance Ti...
      • Page File = RAM x 1.5? Not so fast if you're x64...
      • AsmSpy [Assembly Spy] (Think "commandDepends for ...
      • "Introducing Windows 8.1 for IT Professionals: Tec...
      • patterns & practices: Data Access Guidance code dr...
      • "Windows Server Essentials Media Pack" (DNLA Strea...
      • You can only turn "SecureBoot isn't configured cor...
      • sp_AskBrent - Your new, "OMG, my SQL Server is soo...
      • Shining the light on 30 Code Samples, 9 Technologi...
      • bing up your app with the new Bing Speech Recognit...
      • Magic Method to Move from Windows 8.1 Preview to W...
      • Visual Studio 2013, Team Foundation Server 2013, ....
      • Windows 8.1 Now Available...(For Everyone)
      • [Hardware Review] It's been a Haswell Summer... Ha...
      • Revisiting Sando - Full Text Index and Source your...
      • IntelliCommand, the key to learning Visual Studio ...
      • PIE! (charts) - Log Parser and the Office Web Comp...
      • Besides tearing your hair out, how you debug why y...
      • Some TweetSharp, Accord.Net and the author's code ...
      • Habitat for Humanity SF/SCV, USO Greater Los Angel...
      • //? = Taking "Google Coding" to the next level? Fl...
      • This is a railroading you'll actually look forward...
      • How do the Microsoft Office Servers Integrate? Her...
      • Making SQL Server a happy kCura Relativity camper ...
      • Grant's TFS Grooming Guide (Think "How to keep you...
      • OpenGov.com, where your Local Government can get n...
      • Comparing Sentiment Analysis REST API's
      • XAML Spy v2 Beta Visual Studio now available... (t...
      • DebugDiag v2 is now out...
      • The Surface surface... Three Surface sites you sho...
      • VMware or Microsoft? 35 posts, six weeks, two prod...
      • No need to say no to NoSql - "Data Access for High...
      • Can you Kinect me now... Using the Kinect for Wind...
      • A Decade+ of Start Pages - Visual Studio Start Pag...
      • [Insert really lame Mime joke here] MimeKit v0.5 (...
      • Lets Get Physical [JavaScript] - PhysicsJS
      • WAMVA - Windows Azure Microsoft Virtual Academy co...
      • This is IT for Azure... "Introducing Windows Azure...
    • ►  September (38)
    • ►  August (47)
    • ►  July (75)
    • ►  June (39)
    • ►  May (40)
    • ►  April (42)
    • ►  March (39)
    • ►  February (42)
Powered by Blogger.

About Me

Unknown
View my complete profile