Autofac register assembly types

Sometimes AppDomain.CurrentDomain.GetAssemblies doesn't return assemblies of dependent projects. Detailed explanation here Difference between AppDomain.GetAssemblies and BuildManager.GetReferencedAssemblies

In those cases, we should get those project assemblies individually using any class inside the project and register its types.

var webAssembly = Assembly.GetExecutingAssembly();
var repoAssembly = Assembly.GetAssembly(typeof(SampleRepository)); // Assuming SampleRepository is within the Repository project
builder.RegisterAssemblyTypes(webAssembly, repoAssembly)
            .AsImplementedInterfaces();          

This is the correct way:

builder.RegisterAssemblyTypes(AppDomain.CurrentDomain.GetAssemblies())
       .Where(t => t.Name.EndsWith("Repository"))
       .AsImplementedInterfaces()
       .InstancePerRequest();

For UWP correct way is a bit alter:

   var assemblyType = typeof(MyCustomAssemblyType).GetTypeInfo();

   builder.RegisterAssemblyTypes(assemblyType.Assembly)
   .Where(t => t.Name.EndsWith("Repository"))
   .AsImplementedInterfaces()
   .InstancePerRequest();

For each assembly you have take single type that belongs assembly and retrieve assembly's link from it. Then feed builder this link. Repeat.