protected virtual void ConfigureBootstrapper(GeneratorBootstrapper bootstrapper, GeneratorContext generatorContext) { if (bootstrapper == null) { throw new ArgumentNullException(nameof(bootstrapper)); } if (generatorContext == null) { throw new ArgumentNullException(nameof(generatorContext)); } var configuration = CreateConfiguration(); // This is kept separate from Bootstrapper because you might want to use your own assemblies. // You might also want to pass in your own version of generator context bootstrapper.RegisterConvention( new MultiAssemblyImplementationRegistrationConvention( generatorContext.GeneratorType.GetAssembly())); bootstrapper.RegisterConvention(new GeneratorRegistrationConvention(configuration, generatorContext)); }