Skip to content

Instantly share code, notes, and snippets.

Avatar

Mads Kristensen madskristensen

View GitHub Profile
@madskristensen
madskristensen / RemoveBadgeInVS.ps1
Last active Sep 22, 2020
Remove Preview badge in VS
View RemoveBadgeInVS.ps1
$search = "C:\Program Files (x86)\Microsoft Visual Studio\"
Write-Host "Looking for PreviewBadge.pkgdef..."
$file = Get-ChildItem -Path $search -Include *previewbadge.pkgdef -Recurse
if ($file){
Remove-Item $file
Write-Host "PreviewBadge.pkgdef deleted"
@madskristensen
madskristensen / tools.md
Last active May 3, 2018
Extensibility tools
View tools.md
@madskristensen
madskristensen / VSIX-Checklist.md
Last active Jan 23, 2021
VS extension checklist
View VSIX-Checklist.md

Visual Studio Extensibility Checklist

Here is a list of things to make sure to remember before publishing your Visual Studio extension.

Adhere to threading rules

Add the Microsoft.VisualStudio.SDK.Analyzers NuGet package to your VSIX project, which will help you discover and fix common violations of best practices regarding threading.

Add high-quality icon

All extensions should have an icon associated with it. Make sure the icon is a high-quality .png file with the size 90x90 pixels in 96 DPI or more. After adding the icon to your VSIX project, register it in the .vsixmanifest file as both the Icon and Preview image.

Name and description

@madskristensen
madskristensen / vs-2017-api-samples.md
Last active Apr 5, 2018
Links to samples of how to use various APIs in the Visual Studio SDK
View vs-2017-api-samples.md
@madskristensen
madskristensen / _Layout.cshtml
Last active Apr 15, 2021
Social sharing buttons for ASP.NET Core
View _Layout.cshtml
<!-- Render the partial -->
@{await Html.RenderPartialAsync("_SocialSharing", ViewData["Title"]);}
@madskristensen
madskristensen / ETagMiddleware.cs
Last active Mar 10, 2021
ASP.NET Core ETAg middleware
View ETagMiddleware.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Net.Http.Headers;
using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
public class ETagMiddleware
{
@madskristensen
madskristensen / SetEditorSettings.cs
Created Aug 22, 2016
How to set basic settings to any language in VS
View SetEditorSettings.cs
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;
namespace YamlSpacesFix
{
[Export(typeof(IWpfTextViewCreationListener))]
[ContentType(ContentType)]
[TextViewRole(PredefinedTextViewRoles.PrimaryDocument)]
public class YamlCreationListener : IWpfTextViewCreationListener
@madskristensen
madskristensen / VSIX UIContext
Last active Jan 15, 2021
Shows how to add custom UIContexts
View VSIX UIContext
On the package
[ProvideAutoLoad(UIContexts.LoadContext)]
[ProvideUIContextRule(UIContexts.LoadContext,
"RightFileTypeOpen",
"(CSharpFileOpen | VBFileOpen)",
new[] { "CSharpFileOpen", "VBFileOpen" },
new[] { "ActiveEditorContentType:CSharp", "ActiveEditorContentType:Basic" })]
In the VSCT
@madskristensen
madskristensen / devenv.pkgundef
Last active Sep 15, 2020
Disable built-in Visual Studio packages
View devenv.pkgundef
//********************************************************//
// HOW TO:
// Create a file called devenv.pkgundef in the same directory as devenv.exe.
// It's usually located at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
// Then call "devenv.exe /updateconfiguration" from an elevated command prompt.
// REMARKS:
// Each GUID below represent a package that Visual Studio is loading. This is the
// list of package that I personally don't ever use. You can modify the list of