Skip to content

Instantly share code, notes, and snippets.

@sharwell
Created April 19, 2013 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharwell/5421001 to your computer and use it in GitHub Desktop.
Save sharwell/5421001 to your computer and use it in GitHub Desktop.
Minimal implementation of `Package` to register and provide an implementation of `IVsLanguageInfo`.
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
using IServiceContainer = System.ComponentModel.Design.IServiceContainer;
[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProductRegistration("#110", "#111", "1.0")]
[ProvideLanguageService(typeof(ExampleLanguageInfo), "Example", 100)]
[ProvideLanguageExtension(typeof(ExampleLanguageInfo), ".e1")]
[ProvideLanguageExtension(typeof(ExampleLanguageInfo), ".e2")]
[Guid("your guid here")]
public class ExamplePackage : Package
{
private ExampleLanguageInfo _languageInfo;
protected override void Initialize()
{
base.Initialize();
_languageInfo = new ExampleLanguageInfo();
((IServiceContainer)this).AddService(typeof(ExampleLanguageInfo), _languageInfo, true);
}
}
@sdcb
Copy link

sdcb commented Aug 29, 2017

Can you please provide detailed assembly version info?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment