These are chat archives for ExtCore/ExtCore

Feb 2018
Richard Simpson
Feb 08 2018 14:06
not sure if this is the place to ask, but I feel I'm missing something obvious when adding an extension as a direct reference in a solution
Is there a particularly wiring up which needs to take please?
*take place
My understanding would be the ExtensionManager will just discover classes implementing IExtension
Dmitry Sikorsky
Feb 08 2018 14:19
Hi @simquad ! It is not important how the modules (or extensions) are added to the application. Whether it is direct dependency, source code, NuGet, dll etc. When extension is added, controllers, views, files (if you added them as resources), view components etc are just resolved automatically. If you have some interface IInterface defined in some of the extension, you can then use ExtensionManager to get all the implementations of that interface from all of the extensions. Of course, extensions that implement that interface must have dependency on its package - this is normal. For example, you can describe some service and have 2 different implementations in 2 different packages.Then you can just use one or another package, so implementation will be changed.
Richard Simpson
Feb 08 2018 14:19
Hi Dmitry, thanks for the response
I have:
   public class AwesomeExtension : ExtensionBase
        public override string Name => "AwesomeExtension";

and trying to resolve using:

await context.Response.WriteAsync(ExtensionManager.GetInstance<IExtension>().Name);

as a really simple test, doesn't seem to load the Extension

Added as a ref:
    <ProjectReference Include="..\ExtensionOne\ExtensionOne.csproj" />
Unless the doc's are slightly out of date?
Richard Simpson
Feb 08 2018 14:35
(not sure if I need to tag @DmitrySikorsky )