<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/writing-clrmd-extensions-for-windbg-and-lldb-zkwvddhgu" -->

---
title: Writing ClrMD extensions for WinDbg and LLDB | daily.dev
description: A walkthrough of building debugger extensions using the ClrMDExports NuGet package that work in both WinDbg and LLDB. Covers creating a Class Library project,...
canonical: https://daily.dev/posts/writing-clrmd-extensions-for-windbg-and-lldb-zkwvddhgu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Writing ClrMD extensions for WinDbg and LLDB | daily.dev
og:description: A walkthrough of building debugger extensions using the ClrMDExports NuGet package that work in both WinDbg and LLDB. Covers creating a Class Library project,...
og:url: https://daily.dev/posts/writing-clrmd-extensions-for-windbg-and-lldb-zkwvddhgu
og:image: https://api.daily.dev/og/posts/zKWvDDHgu.png
og:image:alt: Writing ClrMD extensions for WinDbg and LLDB
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing ClrMD extensions for WinDbg and LLDB

**[Kevin Gosse \(minidump.net\)](https://daily.dev/sources/minidump)** · 5 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of building debugger extensions using the ClrMDExports NuGet package that work in both WinDbg and LLDB. Covers creating a Class Library project, adding commands via the DllExport attribute and DebuggingContext.Execute, and using the author's LLDB-LoadManaged meta-plugin to translate WinDbg-style extensions for use in LLDB on Linux. Notes a current limitation where LoadManaged and the SOS plugin cannot be used simultaneously due to .NET Core CLR's lack of side-by-side support.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://minidump.net/writing-clrmd-extensions-for-windbg-and-lldb-916427956f66>

## Questions this post answers

### How do I write a ClrMD debugger extension that works in both WinDbg and LLDB?

Use the ClrMDExports NuGet package, which pulls in ClrMD and UnmanagedExports.Repack as dependencies and auto-generates an Init.cs file handling WinDbg's DebugExtensionInitialize export. Create static methods decorated with the DllExport attribute, calling DebuggingContext.Execute with a callback taking (ClrRuntime runtime, string args); the project must target x86 or x64, not AnyCPU.

_Developers building cross-platform .NET debugging tools can track ClrMD extension patterns like this on daily.dev._

### Can I use LLDB to load a WinDbg-style ClrMD extension on Linux?

Yes, by using the LLDB-LoadManaged meta-plugin, which translates WinDbg-style extensions for LLDB. Load it with 'plugin load ./loadmanaged/libloadmanaged.so', ensure Mono.Cecil.dll and PluginInterop.dll sit alongside it, optionally set the CLR path with SetClrPath, then load the extension with the LoadManaged command, which does not yet support relative paths.

_Those debugging .NET Core on Linux can follow setups like this one for LLDB tooling on daily.dev._

### Can I use LLDB-LoadManaged and the SOS plugin at the same time in LLDB?

No, because both libloadmanaged.so and libsosplugin.so each host their own CLR, and the .NET Core CLR does not support side-by-side hosting scenarios. This is a known limitation unlikely to be fixed on the .NET Core side; a planned workaround is a managed version of SOS loadable through LoadManaged to replace libsosplugin.so entirely.

_Engineers hitting CLR hosting limits in cross-platform debugging workflows can follow updates on daily.dev._

## Similar posts on daily.dev

- [Writing a Debugger from Scratch](https://daily.dev/posts/writing-a-debugger-from-scratch-hufblqwhg) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#.net](https://daily.dev/tags/.net)

[View this post on daily.dev](https://daily.dev/posts/writing-clrmd-extensions-for-windbg-and-lldb-zkwvddhgu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Writing ClrMD extensions for WinDbg and LLDB","url":"https://daily.dev/posts/writing-clrmd-extensions-for-windbg-and-lldb-zkwvddhgu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/writing-clrmd-extensions-for-windbg-and-lldb-zkwvddhgu"},"datePublished":"2026-10-04T13:05:11.404Z","dateModified":"2026-10-04T13:11:26.953Z","description":"A walkthrough of building debugger extensions using the ClrMDExports NuGet package that work in both WinDbg and LLDB. Covers creating a Class Library project,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2c34827a0c64b5dd021f31e451aadc88?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2c34827a0c64b5dd021f31e451aadc88?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Kevin Gosse (minidump.net)","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Kevin Gosse (minidump.net)","logo":"https://media.daily.dev/image/upload/s--8KHn1aFB--/f_auto,q_auto/v1791119046/logos/minidump?_a=BAMAMicg0","url":"https://daily.dev/sources/minidump"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/writing-clrmd-extensions-for-windbg-and-lldb-zkwvddhgu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":".net","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Kevin Gosse (minidump.net)","item":"https://daily.dev/sources/minidump"},{"@type":"ListItem","position":3,"name":"Writing ClrMD extensions for WinDbg and LLDB"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/writing-clrmd-extensions-for-windbg-and-lldb-zkwvddhgu#faq","mainEntity":[{"@type":"Question","name":"How do I write a ClrMD debugger extension that works in both WinDbg and LLDB?","acceptedAnswer":{"@type":"Answer","text":"Use the ClrMDExports NuGet package, which pulls in ClrMD and UnmanagedExports.Repack as dependencies and auto-generates an Init.cs file handling WinDbg's DebugExtensionInitialize export. Create static methods decorated with the DllExport attribute, calling DebuggingContext.Execute with a callback taking (ClrRuntime runtime, string args); the project must target x86 or x64, not AnyCPU. Developers building cross-platform .NET debugging tools can track ClrMD extension patterns like this on daily.dev."}},{"@type":"Question","name":"Can I use LLDB to load a WinDbg-style ClrMD extension on Linux?","acceptedAnswer":{"@type":"Answer","text":"Yes, by using the LLDB-LoadManaged meta-plugin, which translates WinDbg-style extensions for LLDB. Load it with 'plugin load ./loadmanaged/libloadmanaged.so', ensure Mono.Cecil.dll and PluginInterop.dll sit alongside it, optionally set the CLR path with SetClrPath, then load the extension with the LoadManaged command, which does not yet support relative paths. Those debugging .NET Core on Linux can follow setups like this one for LLDB tooling on daily.dev."}},{"@type":"Question","name":"Can I use LLDB-LoadManaged and the SOS plugin at the same time in LLDB?","acceptedAnswer":{"@type":"Answer","text":"No, because both libloadmanaged.so and libsosplugin.so each host their own CLR, and the .NET Core CLR does not support side-by-side hosting scenarios. This is a known limitation unlikely to be fixed on the .NET Core side; a planned workaround is a managed version of SOS loadable through LoadManaged to replace libsosplugin.so entirely. Engineers hitting CLR hosting limits in cross-platform debugging workflows can follow updates on daily.dev."}}]}
```

