{"id":13594690,"url":"https://github.com/VsixCommunity/Community.VisualStudio.Toolkit","last_synced_at":"2025-04-09T07:33:46.285Z","repository":{"id":36997071,"uuid":"356981273","full_name":"VsixCommunity/Community.VisualStudio.Toolkit","owner":"VsixCommunity","description":"Making it easier to write Visual Studio extensions","archived":false,"fork":false,"pushed_at":"2024-02-06T18:07:53.000Z","size":1425,"stargazers_count":246,"open_issues_count":61,"forks_count":41,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-04-28T08:46:14.444Z","etag":null,"topics":["visual-studio","visual-studio-extension","vs-extension","vsix"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VsixCommunity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"madskristensen"}},"created_at":"2021-04-11T21:15:42.000Z","updated_at":"2024-04-06T00:53:37.000Z","dependencies_parsed_at":"2023-02-14T20:16:02.230Z","dependency_job_id":"f602f54f-0ece-4247-b657-b77bc76b5a08","html_url":"https://github.com/VsixCommunity/Community.VisualStudio.Toolkit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VsixCommunity%2FCommunity.VisualStudio.Toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VsixCommunity%2FCommunity.VisualStudio.Toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VsixCommunity%2FCommunity.VisualStudio.Toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VsixCommunity%2FCommunity.VisualStudio.Toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VsixCommunity","download_url":"https://codeload.github.com/VsixCommunity/Community.VisualStudio.Toolkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223375410,"owners_count":17135366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["visual-studio","visual-studio-extension","vs-extension","vsix"],"created_at":"2024-08-01T16:01:37.648Z","updated_at":"2024-11-06T16:31:46.040Z","avatar_url":"https://github.com/VsixCommunity.png","language":"C#","funding_links":["https://github.com/sponsors/madskristensen"],"categories":["C#","C\\#"],"sub_categories":[],"readme":"# Community toolkit for Visual Studio extensions\n\nA community driven effort for a better Visual Studio experience developing extensions.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/0p4wvtwuj55qixhr?svg=true)](https://ci.appveyor.com/project/madskristensen/community-visualstudio-toolkit-1dwx1)\n[![NuGet](https://img.shields.io/nuget/vpre/Community.VisualStudio.Toolkit.17)](https://nuget.org/packages/Community.VisualStudio.Toolkit.17/)\n\nThe NuGet package [Community.VisualStudio.Toolkit.17](https://www.nuget.org/packages/Community.VisualStudio.Toolkit.17/) acts as a companion to the regular Visual Studio SDK packages with helper methods, classes and extension methods that makes writing extensions a lot easier. \n\n* The [VSIX Cookbook](https://www.vsixcookbook.com) shows you how to build extensions using this toolkit\n* [Community.VisualStudio.Toolkit.17](https://www.nuget.org/packages/Community.VisualStudio.Toolkit.17/) official NuGet package\n* [CI NuGet feed](https://ci.appveyor.com/nuget/community-visualstudio-toolkit) for nightly builds\n\n## Supported versions\n\n* Visual Studio 2015 ([Community.VisualStudio.Toolkit.14](https://www.nuget.org/packages/Community.VisualStudio.Toolkit.14/))\n* Visual Studio 2017 ([Community.VisualStudio.Toolkit.15](https://www.nuget.org/packages/Community.VisualStudio.Toolkit.15/))\n* Visual Studio 2019 ([Community.VisualStudio.Toolkit.16](https://www.nuget.org/packages/Community.VisualStudio.Toolkit.16/))\n* Visual Studio 2022 ([Community.VisualStudio.Toolkit.17](https://www.nuget.org/packages/Community.VisualStudio.Toolkit.17/))\n\n## Try the nightly builds\n\nCreate a file called **nuget.config** in your solution folder, and paste in the following content:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cconfiguration\u003e\n  \u003cpackageSources\u003e\n    \u003cadd key=\"nuget.org\" value=\"https://api.nuget.org/v3/index.json\" /\u003e\n    \u003cadd key=\"Toolkit CI\" value=\"https://ci.appveyor.com/nuget/community-visualstudio-toolkit\" /\u003e\n  \u003c/packageSources\u003e\n\u003c/configuration\u003e\n```\n\n## Examples\nHere are some examples of typical scenarios used in extensions.\n\n### Commands\nYou can now write commands much simpler than you're used to. Here's what a command that opens a tool window would look like:\n\n```c#\n[Command(PackageIds.RunnerWindow)]\ninternal sealed class RunnerWindowCommand : BaseCommand\u003cRunnerWindowCommand\u003e\n{\n    protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) =\u003e\n        await RunnerWindow.ShowAsync();\n}\n```\n\n### Writing to the Status Bar\n\n``` C#\nawait VS.StatusBar.ShowMessageAsync(\"My status bar text\");\n```\n\n### Showing a message box\n\n``` C#\nawait VS.MessageBox.ShowAsync(\"Title\", \"Message\");\n```\n\n### Log error to output window\nSynchronous version:\n\n``` C#\ncatch (Exception ex)\n{\n    ex.Log();\n}\n```\n\nAsync version:\n\n``` C#\ncatch (Exception ex)\n{\n    await ex.LogAsync();\n}\n```\n\n### Dependency Injection\nTo incorporate a DI container into your extension, see the complimentary project: [\nCommunity.VisualStudio.Toolkit.DependencyInjection](https://github.com/VsixCommunity/Community.VisualStudio.Toolkit.DependencyInjection)\n\n## Purpose\nThis package attempts to solve multiple issues with the current extensibility model.\n\n### Too much boilerplate is needed to do simple things\nBase classes, helper methods, and extension methods encapsulate the complexity so you don't have to. \n\n### It's difficult to find what services and components to use\nNow the most common services are all easy to get to from the main `VS` object.\n\n### Best practices change with each version of VS. I can't keep up\nThe underlying implementation of the project uses the best practices for each version of VS it supports. This ensures that your extension is much more likely to handle threading correctly, and avoid hangs and crashes.\n\n### The API is dated and has lots of ugly COM legacy noise\nThe most common APIs of the old complex COM nature are wrapped to expose a modern async API. This makes it much easier to code against the API and you can avoid the `EnvDTE` object for most scenarios.\n\n### The API isn't async and getting threading right is too hard\nAll the base classes and helper methods are async by default. There are cases where they are not, but that is because it wouldn't be beneficial for them to be. \n\n### Only Microsoft can update the API and that doesn't scale\nThis is a living project where the whole community can contribute helpers on top of the official VS SDK. There is no need to wait for Microsoft to make an update, since this project gives the ability to continue the work in a separate work stream.\n\n### Breaking changes in the API between VS version are painful\nThis project works around those changes in the implementation of its public contracts and interfaces. This means that what was a breaking change to the VS SDK, becomes an implementation detail of this project and no user will be affected.\n\n## Templates\nFor both project- and item templates that utilizes this NuGet packages, download the Extensibility Template Pack:\n* [Extensibility Template Pack 2022](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ExtensibilityItemTemplates2022) (Visual Studio 2022)\n* [Extensibility Template Pack 2019](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ExtensibilityItemTemplates) (Visual Studio 2019)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVsixCommunity%2FCommunity.VisualStudio.Toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVsixCommunity%2FCommunity.VisualStudio.Toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVsixCommunity%2FCommunity.VisualStudio.Toolkit/lists"}