{"id":27182,"date":"2020-03-18T00:00:00","date_gmt":"2020-03-17T23:00:00","guid":{"rendered":"https:\/\/blexin.com\/caricare-plugin-in-applicazioni-net\/"},"modified":"2021-05-20T18:36:47","modified_gmt":"2021-05-20T16:36:47","slug":"loading-plugins-in-net-applications","status":"publish","type":"post","link":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/","title":{"rendered":"Loading plugins in .NET applications"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"608\" data-attachment-id=\"27177\" data-permalink=\"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/attachment\/top00-4-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=1024%2C608&amp;ssl=1\" data-orig-size=\"1024,608\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"top00-4\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=300%2C178&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=1024%2C608&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?resize=1024%2C608&#038;ssl=1\" alt=\"\" class=\"wp-image-27177\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png 1024w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4-980x582.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4-480x285.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">During the development of our own CMS WebRight, we found that people from outside the team also need to develop plugins. I thought it might be interesting to tell you how we dealt with the problem, showing you how to develop a plugin system for your .NET applications.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first problem to be solved is to recognize plugins among loaded assemblies. We decided to use an interface allowing those who implement it to decide what a plugin is to us. Since WebRight is based on our Framework Raptor, the name of the interface is&nbsp;<strong>IRaptorPlugin<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic interface IRaptorPlugin\n{\n\u00a0\u00a0\u00a0\u00a0string Name { get; }\n\u00a0\n\u00a0\u00a0\u00a0\u00a0string Version { get; }\n\u00a0\n\u00a0\u00a0\u00a0\u00a0void OnLoad();\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Suppose we want to create a plugin to manage a menu. We create a library containing a class, which implements the interface:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic class MenuPlugin : IRaptorPlugin\n{\n\u00a0\u00a0\u00a0\u00a0public string Name =&gt; &quot;Menu&quot;;\n\u00a0\n\u00a0\u00a0\u00a0\u00a0public string Version =&gt; &quot;1.0.0&quot;\n\u00a0\n\u00a0\u00a0\u00a0\u00a0public void OnLoad()\n\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0}\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">We are already able to load the plugin in the CMS, recognizing this class, thanks to&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.blexin.com\/en-US\/Article\/Blog\/Improve-you-code-with-Reflection-52\" target=\"_blank\">Reflection<\/a>. We create a plugin manager which does the dirty work for us, and I show you a simplified version of it that highlights main aspects:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic class RaptorPluginManager : IRaptorPluginManager\n{\n\u00a0\u00a0\u00a0\u00a0public ICollection&lt;Assembly&gt; Plugins { get; private set; }\n\u00a0\n\u00a0\n\u00a0\u00a0\u00a0\u00a0public RaptorPluginManager(string path, IServiceCollection services)\n\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.Plugins = new List&lt;Assembly&gt;();\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0string&#x5B;] dlls = Directory.GetFiles(path, &quot;*.dll&quot;, SearchOption.AllDirectories);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0foreach (var dll in dlls)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var plugin = Assembly.LoadFrom(dll);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var pluginClass = plugin.GetTypes().Where(x =&gt; typeof(IRaptorPlugin).IsAssignableFrom(x)).SingleOrDefault();\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (pluginClass != null)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var pluginInstance = Activator.CreateInstance(pluginClass);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var loadMethod = pluginClass.GetMethod(&quot;OnLoad&quot;);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0loadMethod.Invoke(pluginInstance, null);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.Plugins.Add(plugin);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">This code just only searches all DLL in a specific folder, and for any element it finds, verify if there is an&nbsp;<strong>IRaptorPlugin<\/strong>&nbsp;implementation. The method&nbsp;<strong>OnLoad<\/strong>&nbsp;is executed for each implementation, and it can be used to populate a configuration or to make a data&nbsp;<em>seed<\/em>, which can be collected in a plugin list.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once we get the list, we can load the framework\u2019s specific features. Since we are now using a CMS, we defined<strong>&nbsp;Page<\/strong>&nbsp;and&nbsp;<strong>Widget<\/strong>&nbsp;concepts, using the first one to display a page of contents, and the second one to show a specific section on the content inside a page. Within the implementation of WebRight in ASP.NET Core, a Page is an MVC&nbsp;<em>View<\/em>, that we can reach thanks to a specific path, and a widget is a&nbsp;<em>ViewComponent<\/em>&nbsp;(find the definition in my&nbsp;<a href=\"https:\/\/www.blexin.com\/en-US\/Article\/Blog\/Kestrel-build-me-up-31\" target=\"_blank\" rel=\"noreferrer noopener\">article<\/a>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s complete our plugin with the code to insert a Menu widget. Using the same process used for the plugin, we can say that a widget is a class which implements a specific interface; in our case, it is named &nbsp;<strong>IWebRightWidget<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic interface IWebRightWidget\n{\n\u00a0\u00a0\u00a0\u00a0IWebRightBaseViewModel GetViewModel(string language, object&#x5B;] parameters);\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">This interface not only&nbsp;<em>marks<\/em>&nbsp;a class as a WebRight widget but also allows you to define how the data needed for its operation are recovered, whose data will then be reverted to a classic&nbsp;<em>ViewModel<\/em>. For example, if data for a menu widget is defined within a&nbsp;<strong>WebRightMenuViewModel<\/strong>&nbsp;class, which will extend a base class of the framework or implement&nbsp;<strong>IWebRightBaseViewModel&nbsp;<\/strong>directly, the widget implementation will look something like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic class WebRightMenuWidget : IWebRightWidget\n{\n\u00a0\u00a0\u00a0\u00a0public IRaptorBaseViewModel GetViewModel(string language, object&#x5B;] parameters)\n\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0WebRightMenuViewModel vm = new WebRightMenuViewModel();\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2026 view model fill logic ...\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return vm; \n\u00a0\u00a0\u00a0\u00a0}\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">How does the framework know that there is a widget in the plugin? WebRight defines a&nbsp;<strong>WidgetFactory<\/strong>&nbsp;that contains a method that, given the name of the widget, verifies its existence and returns it to the caller who will display it:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic IWebRightWidget GetWidgetByName(string name)\n{\n\u00a0\u00a0\u00a0\u00a0if (cache.Exists(name))\n\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return cache.Get&lt;IWebRightWidget&gt;(name);\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0else\n\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var widgetType = pluginManager.Plugins.GetTypes()\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.Where(y =&gt; typeof(IWebRightWidget).IsAssignableFrom(y) &amp;&amp; y.Name == name)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.FirstOrDefault();\n\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (widgetType != null)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var widget = (IWebRightWidget)this.serviceProvider.GetService(widgetType);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0cache.Add&lt;IWebRightWidget&gt;(widget, name);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return widget;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0foreach (var plugin in this.pluginManager.Plugins)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0widgetType = plugin.GetTypes()\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.Where(y =&gt; typeof(IWebRightWidget).IsAssignableFrom(y) &amp;&amp; y.Name == name)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.FirstOrDefault();\n\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (widgetType != null)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var widget = (IWebRightWidget)this.serviceProvider.GetService(widgetType);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0cache.Add&lt;IWebRightWidget&gt;(widget, name);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return widget;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0throw new WebRightWidgetNotFoundException(name);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The method verifies if there is the required widget among the plugins exposed by the PluginManager. If it found it, adds it to a cache to speed up subsequent requests and return it; otherwise, it raises an exception.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see, it is a matter of establishing conventions and using the Reflection of .NET, optimizing performance by using the cache. The code we have in production is obviously a little more complex than that, but the basic idea is the one exposed. If you are curious to know how then the widget is displayed, you can read one of my previous&nbsp;<a href=\"https:\/\/www.blexin.com\/en-US\/Article\/Blog\/Kestrel-build-me-up-31\" target=\"_blank\" rel=\"noreferrer noopener\">articles<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See you on the next article!<\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>Let\u2019s see how adding a plugin mechanism in a .NET Core application<\/p>\n","protected":false},"author":196716246,"featured_media":27177,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_crdt_document":"","inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false},"categories":[688637524],"tags":[688637416,688637384,688637443,688637444],"class_list":["post-27182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-en","tag-asp-net-core-en","tag-c-en","tag-raptor-en","tag-webright-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Loading plugins in .NET applications - Blexin<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Loading plugins in .NET applications - Blexin\" \/>\n<meta property=\"og:description\" content=\"Let\u2019s see how adding a plugin mechanism in a .NET Core application\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/\" \/>\n<meta property=\"og:site_name\" content=\"Blexin\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-17T23:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-20T16:36:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=1024%2C608&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"608\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Francesco de Vicariis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Francesco de Vicariis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/\"},\"author\":{\"name\":\"Francesco de Vicariis\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#\\\/schema\\\/person\\\/6f8514ed8b0d3be31369ca5436c4781f\"},\"headline\":\"Loading plugins in .NET applications\",\"datePublished\":\"2020-03-17T23:00:00+00:00\",\"dateModified\":\"2021-05-20T16:36:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/\"},\"wordCount\":595,\"image\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/top00-4.png?fit=1024%2C608&ssl=1\",\"keywords\":[\"Asp.net core\",\"C#\",\"Raptor\",\"Webright\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/\",\"url\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/\",\"name\":\"Loading plugins in .NET applications - Blexin\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/top00-4.png?fit=1024%2C608&ssl=1\",\"datePublished\":\"2020-03-17T23:00:00+00:00\",\"dateModified\":\"2021-05-20T16:36:47+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#\\\/schema\\\/person\\\/6f8514ed8b0d3be31369ca5436c4781f\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/top00-4.png?fit=1024%2C608&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/top00-4.png?fit=1024%2C608&ssl=1\",\"width\":1024,\"height\":608},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/loading-plugins-in-net-applications\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blexin.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Loading plugins in .NET applications\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/blexin.com\\\/en\\\/\",\"name\":\"Blexin\",\"description\":\"Con noi \u00e8 semplice\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blexin.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#\\\/schema\\\/person\\\/6f8514ed8b0d3be31369ca5436c4781f\",\"name\":\"Francesco de Vicariis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b3a3164fd0b28d429cd427aafae38a687a41a250a2bccf4ab3b0744138afd64e?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b3a3164fd0b28d429cd427aafae38a687a41a250a2bccf4ab3b0744138afd64e?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b3a3164fd0b28d429cd427aafae38a687a41a250a2bccf4ab3b0744138afd64e?s=96&d=identicon&r=g\",\"caption\":\"Francesco de Vicariis\"},\"url\":\"https:\\\/\\\/blexin.com\\\/en\\\/author\\\/francesco-devicariisblexin-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Loading plugins in .NET applications - Blexin","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:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/","og_locale":"en_US","og_type":"article","og_title":"Loading plugins in .NET applications - Blexin","og_description":"Let\u2019s see how adding a plugin mechanism in a .NET Core application","og_url":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/","og_site_name":"Blexin","article_published_time":"2020-03-17T23:00:00+00:00","article_modified_time":"2021-05-20T16:36:47+00:00","og_image":[{"width":1024,"height":608,"url":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=1024%2C608&ssl=1","type":"image\/png"}],"author":"Francesco de Vicariis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Francesco de Vicariis","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/#article","isPartOf":{"@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/"},"author":{"name":"Francesco de Vicariis","@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/6f8514ed8b0d3be31369ca5436c4781f"},"headline":"Loading plugins in .NET applications","datePublished":"2020-03-17T23:00:00+00:00","dateModified":"2021-05-20T16:36:47+00:00","mainEntityOfPage":{"@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/"},"wordCount":595,"image":{"@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=1024%2C608&ssl=1","keywords":["Asp.net core","C#","Raptor","Webright"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/","url":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/","name":"Loading plugins in .NET applications - Blexin","isPartOf":{"@id":"https:\/\/blexin.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/#primaryimage"},"image":{"@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=1024%2C608&ssl=1","datePublished":"2020-03-17T23:00:00+00:00","dateModified":"2021-05-20T16:36:47+00:00","author":{"@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/6f8514ed8b0d3be31369ca5436c4781f"},"breadcrumb":{"@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/#primaryimage","url":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=1024%2C608&ssl=1","contentUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=1024%2C608&ssl=1","width":1024,"height":608},{"@type":"BreadcrumbList","@id":"https:\/\/blexin.com\/en\/blog-en\/loading-plugins-in-net-applications\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blexin.com\/en\/"},{"@type":"ListItem","position":2,"name":"Loading plugins in .NET applications"}]},{"@type":"WebSite","@id":"https:\/\/blexin.com\/en\/#website","url":"https:\/\/blexin.com\/en\/","name":"Blexin","description":"Con noi \u00e8 semplice","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blexin.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/6f8514ed8b0d3be31369ca5436c4781f","name":"Francesco de Vicariis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b3a3164fd0b28d429cd427aafae38a687a41a250a2bccf4ab3b0744138afd64e?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b3a3164fd0b28d429cd427aafae38a687a41a250a2bccf4ab3b0744138afd64e?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b3a3164fd0b28d429cd427aafae38a687a41a250a2bccf4ab3b0744138afd64e?s=96&d=identicon&r=g","caption":"Francesco de Vicariis"},"url":"https:\/\/blexin.com\/en\/author\/francesco-devicariisblexin-com\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/top00-4.png?fit=1024%2C608&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pcyUBx-74q","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/27182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/users\/196716246"}],"replies":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/comments?post=27182"}],"version-history":[{"count":7,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/27182\/revisions"}],"predecessor-version":[{"id":32906,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/27182\/revisions\/32906"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/media\/27177"}],"wp:attachment":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/media?parent=27182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/categories?post=27182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/tags?post=27182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}