If you’ve followed any of the API articles that I’ve published then you know that anytime we have the need to include a Personal Access Token (PAT) as part of the Authorization header we have to Base64-encode it first. While it’s pretty easy to jump into your favorite search engine and find an online Base64 encoder (Bing has one built into the search engine!) sometimes it’s nice to not have to leave the Visual Studio IDE. For this reason, I created a simple Visual Studio extension that can Base64 encode/decode text.
The add-in is pretty easy to use and shows up as a tool window that you can dock wherever you like. In the screenshot below, I have it docked at the bottom alongside the Output and Error List windows.
To use it, simply type/paste your text into the textbox on the left and click on the Encode or Decode button. You can copy the results from the textbox on the right.
Also, in the spirit of sharing and learning, I have made this extension available on GitHub. This extension is comprised mostly of the cookie-cutter code that is provided by the Visual Studio extensions template with just enough custom code to provide the encoding/decoding capabilities. However, it serves as yet another example of how you might create an extension for Visual Studio.
If you don’t care about the source code and simply want to use the extension, you can find it in the Visual Studio Marketplace, here.
Check it out if you like and let me know what you think. If you know of any additional features that you’d like to see added, let me know that as well (though, this is a pretty straightforward extension that likely doesn’t need too many more features :-) ).
Video Update
After posting this article, I created a quick tutorial for installing and using this Visual Studio extension. You can watch the tutorial on YouTube here.
Quick Links
- View and download the source code on GitHub, here.
- Install the extension from the Visual Studio Marketplace, here.
- Submit any issues or feature requests, here.
Enjoy!