{"id":19125,"date":"2018-09-26T08:00:08","date_gmt":"2018-09-26T15:00:08","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudio\/?p=19125"},"modified":"2019-02-14T15:23:33","modified_gmt":"2019-02-14T23:23:33","slug":"getting-started-writing-visual-studio-extensions","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/getting-started-writing-visual-studio-extensions\/","title":{"rendered":"Getting started writing Visual Studio extensions"},"content":{"rendered":"<p>I\u2019m often asked how to best learn to build Visual Studio extensions, so here is what I wished someone told me before I got started.<\/p>\n<h2>Don\u2019t skip the introduction<\/h2>\n<p>It\u2019s easy to create a new extensibility project in Visual Studio, but unless you understand the basics of how the extensibility system works, then you are setting yourself up for failure.<\/p>\n<p>The best introduction I know of is <a href=\"https:\/\/channel9.msdn.com\/events\/Build\/2016\/B886\">a session from \/\/build 2016<\/a> and it is as relevant today as it was then.<\/p>\n<div><\/div>\n<h2>Know the resources<\/h2>\n<p>Where do you get more information about the various aspects of the Visual Studio APIs you wish to use? Here are some very helpful websites that are good to study.<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/visualstudio\/extensibility\/starting-to-develop-visual-studio-extensions\">Official documentation<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Microsoft\/VSSDK-Extensibility-Samples\">Official extensibility samples repo on GitHub<\/a><\/li>\n<li><a href=\"https:\/\/gist.github.com\/madskristensen\/7310c0d61694e323f4deeb5a70f35fec\">Visual Studio Extension Checklist<\/a><\/li>\n<li><a href=\"http:\/\/dotneteers.net\/blogs\/divedeeper\/search.aspx?q=learnvsxnow\">LearnVSXNow! series by Dotneteers<\/a><\/li>\n<\/ul>\n<h2>Know how to search for help<\/h2>\n<p>Writing extensions is a bit of a niche activity so searching for help online doesn\u2019t always return relevant results. However, there are ways we can optimize our search terms to generate better results.<\/p>\n<ul>\n<li>Use the precise interface and class names as part of the search term<\/li>\n<li>Try adding the words <em>VSIX<\/em>,<em> VSSDK<\/em> or<em> Visual Studio <\/em>to the search terms<\/li>\n<li>Search directly on GitHub instead of Google\/Bing when possible<\/li>\n<li>Ask questions to other extenders on the <a href=\"https:\/\/gitter.im\/Microsoft\/extendvs\">Gitter.im<\/a> chatroom<\/li>\n<\/ul>\n<h2>Use open source as a learning tool<\/h2>\n<p>You probably have ideas about what you want your extension to do and how it should work. But what APIs should you use and how do you hook it all up correctly? These are difficult questions and a lot of people give up when these go unanswered.<\/p>\n<p>The best way I know of is to find extensions on the <a href=\"https:\/\/marketplace.visualstudio.com\/vs\">Marketplace<\/a> that does similar things or uses similar elements as to what you want to do. Then find the source code for that extension and look at what they did and what APIs they used and go from there.<\/p>\n<h2>Additional tools<\/h2>\n<p>There is an open source extension for Visual Studio that provides additional features for extension authors that I can highly recommend. Grab the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=MadsKristensen.ExtensibilityEssentials\">Extensibility Essentials<\/a> extension on the Marketplace.<\/p>\n<p>Also, a NuGet package exist containing Roslyn Analyzers that will help you writing extensions. Add the <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.VisualStudio.SDK.Analyzers\/\">Microsoft.VisualStudio.SDK.Analyzers<\/a> package to your extension project.<\/p>\n<p>I hope this will give you a better starting point for writing extensions. If I forgot to mention something, please let me know in the comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019m often asked how to best learn to build Visual Studio extensions, so here is what I wished someone told me before I got started. Don\u2019t skip the introduction It\u2019s easy to create a new extensibility project in Visual Studio, but unless you understand the basics of how the extensibility system works, then you are [&hellip;]<\/p>\n","protected":false},"author":642,"featured_media":223570,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[294,156],"class_list":["post-19125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-extensions","tag-visual-studio-2017"],"acf":[],"blog_post_summary":"<p>I\u2019m often asked how to best learn to build Visual Studio extensions, so here is what I wished someone told me before I got started. Don\u2019t skip the introduction It\u2019s easy to create a new extensibility project in Visual Studio, but unless you understand the basics of how the extensibility system works, then you are [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/19125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/642"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=19125"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/19125\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/223570"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=19125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=19125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=19125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}