Files
ILSpy/TestPlugin
Christoph Wille 7a08c6c57d Update NuGet packages; adapt to Dock.Serializer.SystemTextJson 12.1.0.6
Dock 12.1.0.6 removed the public JsonConverterFactoryList/JsonConverterList<T>
converters from Dock.Serializer.SystemTextJson that ILSpyDockJson used to
deserialize IList<T> into ObservableCollection<T>. Dock now does the same
substitution with an internal JsonTypeInfo modifier that swaps CreateObject
for IList<T> enumerables. ILSpyDockJson mirrors that technique in its own
modifier chain, which also removes the per-element JsonSerializer.Serialize
side effect the old converter had.

Also bumps Xaml.Behaviors.Avalonia, ProDataGrid, AwesomeAssertions, CliWrap,
NUnit3TestAdapter, and the decompiler minor version to 11.1.

Assisted-by: Claude:claude-fable-5:Claude Code
2026-08-29 21:10:25 +02:00
..
2011-04-13 11:26:10 +02:00
2025-08-28 20:56:19 -04:00

ILSpy uses MEF (Managed Extensibility Framework) for plugins.
Plugins must be placed in the same directory as ILSpy.exe, and must be called "*.Plugin.dll".

To write a plugin, you need to add a reference to ILSpy.exe and to System.Composition.AttributedModel.
Depending on what your plugin is doing, you might also need references to the other libraries shipping with ILSpy.

Plugins work by exporting types for certain extension points.
Here is a list of extension points:

Adding another language:

	[Export(typeof(Language))]
	public class CustomLanguage : Language
	
	This adds an additional language to the combobox in the toolbar.
	The language has to implement its own decompiler (all the way from IL), but it can also re-use
	the ICSharpCode.Decompiler library to decompile to C#, and then translate the C# code to the target language.

---

Adding an entry to the main menu:

	[ExportMainMenuCommand(Menu = "_File", MenuIcon = "Clear.png", Header = "_Clear List", MenuCategory = "Open", MenuOrder = 1.5)]
	public class UnloadAllAssembliesCommand : SimpleCommand
	
	Menu: menu into which the item is added
	MenuIcon: optional, icon to use for the menu item. Must be embedded as "Resource" (WPF-style resource) in the same assembly as the command type.
	Header: text on the menu item
	MenuCategory: optional, used for grouping related menu items together. A separator is added between different groups.
	MenuOrder: controls the order in which the items appear (items are sorted by this value)

	The command class must implement WPF's ICommand interface.

---

Adding an entry to the tool bar:

	[ExportToolbarCommand(ToolTip = "Clears the current assembly list", ToolbarIcon = "Clear.png", ToolbarCategory = "Open", ToolbarOrder = 1.5)]
	public class UnloadAllAssembliesCommand : SimpleCommand

	ToolTip: the tool tip
	ToolbarIcon: The icon. Must be embedded as "Resource" (WPF-style resource) in the same assembly as the command type.
	ToolbarCategory: optional, used for grouping related toolbar items together. A separator is added between different groups.
	ToolbarOrder: controls the order in which the items appear (items are sorted by this value)

	The command class must implement WPF's ICommand interface.

---

Adding an entry to the context menu:

	[ExportContextMenuEntry(Header = "_Save Assembly")]
	public class SaveAssembly : IContextMenuEntry
	
	Icon: optional, icon to use for the menu item. Must be embedded as "Resource" (WPF-style resource) in the same assembly as the command type.
	Header: text on the menu item
	Category: optional, used for grouping related menu items together. A separator is added between different groups.
	Order: controls the order in which the items appear (items are sorted by this value)
	
	Context menu entries must implement IContextMenuEntry, which defines 3 methods:
	bool IsVisible, bool IsEnabled, and void Execute.

---

Adding an option page:

	[ExportOptionPage("TestPlugin")]
	partial class CustomOptionPage : UserControl, IOptionPage