Initializing the EV5 ViewEngine

In the Startup class you can add the ViewEngine to the list of used MVC ViewEngines via the following line:

services.AddRazorPages()
    .AddViewOptions(o => o.ViewEngines.Insert(0new EmbeddedViewEngine("eve-")));
Here we are suing the AddViewOptions extensionmethod of the IMvcBuilder interface. Note, that you can specify the place of the ViewEngine. It's order will determine the order in which the MVC engine will look for the view names in the engines. So, if you are using EV5 ViewEngine primarily, you can specify that to be the first. Also note, that you can specify a prefix for the registered EV5 ViewEngine. The EV5 ViewEngine will only process views with a name starting with this prefix. This way you can register multiple EV5 viewengines, and direct specific views to specific engines.

Auto Discovering and registering the web parts of plugins

Use the UseEmbeddedPlugins extension of the IServiceCollection in the ConfigureServices method to auto discover the plugins. You have to specify the ICompositionHostFactory that is responsible to find all the IEmbeddedPlugin implementations. By default use the DirCompositionHostFactory class to specify a directory and a search pattern to consider all relevant assemblies.

//This method will discover all exported IEmbeddedPlugins in the provided CompositionHostFactory
           //It will then use the information in these objects to set up the web components and.
           services.UseEmbeddedPlugins(new DirCompositionHostFactory(AppDomain.CurrentDomain.BaseDirectory, "EV5*.dll"));

Prepare File Providers for using the plugins

Use the ConfigureEmbeddedPlugins extension of the IWebHostEnvironment in the Configure method to auto discover the plugins and prepare the environemnt to use CompositeFileProvider containing the FileProviders of the plugins.

env.ConfigureEmbeddedPlugins();
You can use this version of the configure method to access the IWebHostEnvironment:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

Mapping controllers

Finally since EV5 is an MVC engine, you have to make sure that controllers are registered:

app.UseEndpoints(endpoints =>
{
    endpoints.MapRazorPages();
    endpoints.MapControllers();
    endpoints.MapDefaultControllerRoute();
});