{"id":617,"date":"2020-11-03T23:07:00","date_gmt":"2020-11-03T10:07:00","guid":{"rendered":"https:\/\/blog.wiseowls.co.nz\/?p=617"},"modified":"2026-03-08T00:49:19","modified_gmt":"2026-03-07T11:49:19","slug":"attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit","status":"publish","type":"post","link":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/","title":{"rendered":"Attaching debugger to dynamically loaded assembly with Reflection.Emit"},"content":{"rendered":"<p>Imagine a situation where you&#8217;d like to attach a debugger to an assembly that you have loaded dynamically? To make it a bit more plausible let us consider a scenario. Our client has a solution where they maintain extensive plugin ecosystem. Each plugin is a class library built with .net 4.5. Each plugin implements a common interface that main application is aware of. At runtime the application scans a folder and loads all assemblies into separate AppDomains. Under certain circumstances users\/developers would like to be able to debug plugins in Visual Studio.<br \/>Given how seldom we would opt for this technique, documenting our solution might be an exercise in vain. But myself being a huge fan of weird and wonderful &#8211; I couldn&#8217;t resist going through with this case study. <\/p>\n<h2 class=\"wp-block-heading\">Inventorying moving parts<\/h2>\n<p>First of all we&#8217;d need a way to inject code into the assembly. Apparently we can not directly replace methods we loaded from disk &#8211; <code><a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.reflection.emit.methodrental.swapmethodbody?view=netframework-4.8\">SwapMethodBody()<\/a><\/code> needs a <code><a href=\"DynamicMohttps:\/\/github.com\/Microsoft\/referencesource\/blob\/master\/mscorlib\/system\/reflection\/emit\/methodrental.cs#L32dule\">DynamicModule<\/a><\/code>. So we opted to define a <a href=\"https:\/\/refactoring.guru\/design-patterns\/decorator\">subclass wrapper<\/a>. Next, we need to actually stop execution and offer developers to start debugging. Using <code><a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.diagnostics.debugger.launch?view=net-5.0\">Debugger.Launch()<\/a><\/code> is the easiest way to achieve that. Finally, we&#8217;d look at different ways to load assemblies into separate AppDomains to maintain existing convention.<\/p>\n<h2 class=\"wp-block-heading\">Injecting <code>Debugger.Launch()<\/code><\/h2>\n<p>The main attraction here &#8211; and Reflection.Emit is a perfect candidate for the job. Theory is fairly simple: we create a new dynamic assembly, module, type and a method. Then we generate code inside of the method and return wrapper instance:<\/p>\n<pre class=\"wp-block-code\"><code lang=\"csharp\" class=\"language-csharp\">public static object CreateWrapper(Type ServiceType, MethodInfo baseMethod)\n{\n    var asmBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName($\"newAssembly_{Guid.NewGuid()}\"), AssemblyBuilderAccess.Run);\n    var module = asmBuilder.DefineDynamicModule($\"DynamicAssembly_{Guid.NewGuid()}\");\n    var typeBuilder = module.DefineType($\"DynamicType_{Guid.NewGuid()}\", TypeAttributes.Public, ServiceType);\n    var methodBuilder = typeBuilder.DefineMethod(\"Run\", MethodAttributes.Public | MethodAttributes.NewSlot);\n\n    var ilGenerator = methodBuilder.GetILGenerator();\n\n    ilGenerator.EmitCall(OpCodes.Call, typeof(Debugger).GetMethod(\"Launch\", BindingFlags.Static | BindingFlags.Public), null);\n    ilGenerator.Emit(OpCodes.Pop);\n\n    ilGenerator.Emit(OpCodes.Ldarg_0);\n    ilGenerator.EmitCall(OpCodes.Call, baseMethod, null);\n    ilGenerator.Emit(OpCodes.Ret);\n\n    \/*\n     * the generated method would be roughly equivalent to:\n     * new void Run()\n     * {\n     *   Debugger.Launch();\n     *   base.Run();\n     * }\n     *\/\n\n    var wrapperType = typeBuilder.CreateType();\n    return Activator.CreateInstance(wrapperType);\n}<\/code><\/pre>\n<h2 class=\"wp-block-heading\">Triggering the method<\/h2>\n<p>After we&#8217;ve generated a wrapper &#8211; we should be in position to invoke the desired method. In this example I&#8217;m using all-reflection approach:<\/p>\n<pre class=\"wp-block-code\"><code lang=\"csharp\" class=\"language-csharp\">public void Run()\n{\n    var wrappedInstance = DebuggerWrapperGenerator.CreateWrapper(ServiceType, ServiceType.GetMethod(\"Run\"));\n    wrappedInstance.GetType().GetMethod(\"Run\")?.Invoke(wrappedInstance, null);\n \/\/ nothing special here\n}<\/code><\/pre>\n<p>The task becomes even easier if we know the interface to cast to.<\/p>\n<h2 class=\"wp-block-heading\">Adding AppDomain into the mix<\/h2>\n<p>The above parts don&#8217;t depend much on where the code will run. However, trying to satisfy the layout requirement, we experimented with a few different configurations. In the end it appears that I&#8217;m able to confidently place the code in correct <code>AppDomain<\/code> by either leveraging <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.appdomain.docallback?view=netframework-4.7.2\"><code>.DoCallBack()<\/code><\/a> or making sure that Launcher helper is created with <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.appdomain.createinstanceandunwrap?view=netframework-4.7.2\"><code>.CreateInstanceAndUnwrap()<\/code><\/a>:<\/p>\n<pre class=\"wp-block-code\"><code lang=\"csharp\" class=\"language-csharp\">static void Main(string[] args)\n{\n    var appDomain = AppDomain.CreateDomain(\"AppDomainInMain\", AppDomain.CurrentDomain.Evidence,\n        new AppDomainSetup { ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase });\n\n    appDomain.DoCallBack(() =>\n    {\n        var launcher = new Launcher(PathToDll);\n        launcher.Run();\n    });    \n}<\/code><\/pre>\n<pre class=\"wp-block-code\"><code lang=\"csharp\" class=\"language-csharp\">static void Main(string[] args)\n{\n    Launcher.RunInNewAppDomain(PathToDll);\n}\npublic class Launcher : MarshalByRefObject\n{\n    private Type ServiceType { get; }\n\n    public Launcher(string pathToDll)\n    {\n        var assembly = Assembly.LoadFrom(pathToDll);\n        ServiceType = assembly.GetTypes().SingleOrDefault(t => t.Name == \"Class1\");\n    }\n\n    public void Run()\n    {\n        var wrappedInstance = DebuggerWrapperGenerator.CreateWrapper(ServiceType, ServiceType.GetMethod(\"Run\"));\n        wrappedInstance.GetType().GetMethod(\"Run\")?.Invoke(wrappedInstance, null);\n    }\n\n    public static void RunInNewAppDomain(string pathToDll)\n    {\n        var appDomain = AppDomain.CreateDomain(\"AppDomainInLauncher\", AppDomain.CurrentDomain.Evidence, AppDomain.CurrentDomain.SetupInformation);\n\n        var launcher = appDomain.CreateInstanceAndUnwrap(typeof(Launcher).Assembly.FullName, typeof(Launcher).FullName, false, BindingFlags.Public|BindingFlags.Instance,\n            null, new object[] { pathToDll }, CultureInfo.CurrentCulture, null);\n        (launcher as Launcher)?.Run();\n    }\n}<\/code><\/pre>\n<h2 class=\"wp-block-heading\">Testing it<\/h2>\n<p>In the end we&#8217;ve got the following prompt:<\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"420\" height=\"407\" src=\"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/11\/image-1.png\" alt=\"Visual Studio debugger attached to dynamically loaded assembly with breakpoint hit\" class=\"wp-image-624\" srcset=\"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/11\/image-1.png 420w, https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/11\/image-1-300x291.png 300w\" sizes=\"auto, (max-width: 420px) 85vw, 420px\" \/><\/figure>\n<p>after letting it run through, we&#8217;d get something looking like this:<\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"425\" height=\"119\" src=\"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/11\/image.png\" alt=\"Debug symbols loading for Reflection.Emit generated assembly\" class=\"wp-image-623\" srcset=\"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/11\/image.png 425w, https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/11\/image-300x84.png 300w\" sizes=\"auto, (max-width: 425px) 85vw, 425px\" \/><\/figure>\n<p>As usual, full code for this example sits in <a href=\"https:\/\/github.com\/tkhadimullin\/reflection-emit-demo\">my GitHub<\/a> if you want to take it for a spin.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imagine a situation where you&#8217;d like to attach a debugger to an assembly that you have loaded dynamically? To make it a bit more plausible let us consider a scenario. Our client has a solution where they maintain extensive plugin ecosystem. Each plugin is a class library built with .net 4.5. Each plugin implements a &hellip; <a href=\"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Attaching debugger to dynamically loaded assembly with Reflection.Emit&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":353,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[11],"tags":[12],"class_list":["post-617","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev","tag-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Attaching debugger to dynamically loaded assembly with Reflection.Emit - Timur and associates<\/title>\n<meta name=\"description\" content=\"Attaching Visual Studio debugger to code in a dynamically loaded assembly. Reflection.Emit sequence points make it possible.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Attaching debugger to dynamically loaded assembly with Reflection.Emit - Timur and associates\" \/>\n<meta property=\"og:description\" content=\"Attaching Visual Studio debugger to code in a dynamically loaded assembly. Reflection.Emit sequence points make it possible.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/\" \/>\n<meta property=\"og:site_name\" content=\"Timur and associates\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-03T10:07:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-07T11:49:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2021\/01\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1919\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"timur\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@TimurKh\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/\"},\"author\":{\"name\":\"timur\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#\\\/schema\\\/person\\\/34d0ed30d573b5bc317ea990bd2e0c59\"},\"headline\":\"Attaching debugger to dynamically loaded assembly with Reflection.Emit\",\"datePublished\":\"2020-11-03T10:07:00+00:00\",\"dateModified\":\"2026-03-07T11:49:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/\"},\"wordCount\":401,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg\",\"keywords\":[\"c#\"],\"articleSection\":[\"Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/\",\"url\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/\",\"name\":\"Attaching debugger to dynamically loaded assembly with Reflection.Emit - Timur and associates\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg\",\"datePublished\":\"2020-11-03T10:07:00+00:00\",\"dateModified\":\"2026-03-07T11:49:19+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#\\\/schema\\\/person\\\/34d0ed30d573b5bc317ea990bd2e0c59\"},\"description\":\"Attaching Visual Studio debugger to code in a dynamically loaded assembly. Reflection.Emit sequence points make it possible.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg\",\"width\":2560,\"height\":1919,\"caption\":\"Photo by Kevin Ku on Unsplash\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/11\\\/03\\\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Attaching debugger to dynamically loaded assembly with Reflection.Emit\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#website\",\"url\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/\",\"name\":\"Timur and associates\",\"description\":\"Notes of an IT contractor\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#\\\/schema\\\/person\\\/34d0ed30d573b5bc317ea990bd2e0c59\",\"name\":\"timur\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg\",\"caption\":\"timur\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/TimurKh\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Attaching debugger to dynamically loaded assembly with Reflection.Emit - Timur and associates","description":"Attaching Visual Studio debugger to code in a dynamically loaded assembly. Reflection.Emit sequence points make it possible.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/","og_locale":"en_US","og_type":"article","og_title":"Attaching debugger to dynamically loaded assembly with Reflection.Emit - Timur and associates","og_description":"Attaching Visual Studio debugger to code in a dynamically loaded assembly. Reflection.Emit sequence points make it possible.","og_url":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/","og_site_name":"Timur and associates","article_published_time":"2020-11-03T10:07:00+00:00","article_modified_time":"2026-03-07T11:49:19+00:00","og_image":[{"width":2560,"height":1919,"url":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2021\/01\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg","type":"image\/jpeg"}],"author":"timur","twitter_card":"summary_large_image","twitter_creator":"@TimurKh","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/#article","isPartOf":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/"},"author":{"name":"timur","@id":"https:\/\/blog.wiseowls.co.nz\/#\/schema\/person\/34d0ed30d573b5bc317ea990bd2e0c59"},"headline":"Attaching debugger to dynamically loaded assembly with Reflection.Emit","datePublished":"2020-11-03T10:07:00+00:00","dateModified":"2026-03-07T11:49:19+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/"},"wordCount":401,"commentCount":0,"image":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2021\/01\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg","keywords":["c#"],"articleSection":["Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/","url":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/","name":"Attaching debugger to dynamically loaded assembly with Reflection.Emit - Timur and associates","isPartOf":{"@id":"https:\/\/blog.wiseowls.co.nz\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/#primaryimage"},"image":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2021\/01\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg","datePublished":"2020-11-03T10:07:00+00:00","dateModified":"2026-03-07T11:49:19+00:00","author":{"@id":"https:\/\/blog.wiseowls.co.nz\/#\/schema\/person\/34d0ed30d573b5bc317ea990bd2e0c59"},"description":"Attaching Visual Studio debugger to code in a dynamically loaded assembly. Reflection.Emit sequence points make it possible.","breadcrumb":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/#primaryimage","url":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2021\/01\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg","contentUrl":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2021\/01\/kevin-ku-w7ZyuGYNpRQ-unsplash-scaled.jpg","width":2560,"height":1919,"caption":"Photo by Kevin Ku on Unsplash"},{"@type":"BreadcrumbList","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/11\/03\/attaching-debugger-to-dynamically-loaded-assembly-with-reflection-emit\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.wiseowls.co.nz\/"},{"@type":"ListItem","position":2,"name":"Attaching debugger to dynamically loaded assembly with Reflection.Emit"}]},{"@type":"WebSite","@id":"https:\/\/blog.wiseowls.co.nz\/#website","url":"https:\/\/blog.wiseowls.co.nz\/","name":"Timur and associates","description":"Notes of an IT contractor","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.wiseowls.co.nz\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.wiseowls.co.nz\/#\/schema\/person\/34d0ed30d573b5bc317ea990bd2e0c59","name":"timur","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg","caption":"timur"},"sameAs":["https:\/\/x.com\/TimurKh"]}]}},"_links":{"self":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts\/617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/comments?post=617"}],"version-history":[{"count":9,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts\/617\/revisions"}],"predecessor-version":[{"id":1369,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts\/617\/revisions\/1369"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/media\/353"}],"wp:attachment":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/media?parent=617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/categories?post=617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/tags?post=617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}