How do you bind the dependencies of the service dll's at that layer in .NET Core
<p>I would like to make a contained libraries/services in the new .NET Core world. Basically I have several SASS products:</p>

<p>ServiceProduct1: has a repository layer that the UI/Composistion root layer doesn't need to know about.</p>

<p>ServiceProduct2: has a repository layer that the UI/Composistion root layer doesn't need to know about. Has an Email service in it as well.</p>

<p>These two service products are used in multiple applications, but the consuming application has to know to bind the interfaces hidden in the repository. Also the Email service uses Dependency Injection and it has to be 
bound in the consuming application, even though it is used by a service.</p>

<p>Prior to .NET Core I would have used Recursion to search the dlls for things to bind:</p>

<pre class="lang-cs prettyprint-override"><code>public static IKernel LoadAssemblies(IKernel kernel)
{
    var type = typeof(INinjectDependency);
    var dependencies = AppDomain.CurrentDomain.GetAssemblies()
        .SelectMany(x =&gt; x.GetMatchingTypesInAssembly(y =&gt; type.IsAssignableFrom(y) &amp;&amp; y.IsClass));
    var assemblies = dependencies.Select(Assembly.GetAssembly).Distinct();
    kernel.Load(assemblies);
    return kernel;
}
</code></pre>

<p>Then in the consumed services you would do all your binding.        </p>

<p>I am not using Ninject any longer but the concept is the same. Now unless you swap to publish the dll's on build, you cannot use this approach anymore. I do not want to publish my dll's.</p>

<p>Is there another way to handle this?</p>