I am trying to learn developing with Kentico MedioClinic Tutorial. I tried to follow each step accordingly, but I stucked here.

I searched the problem in the caption, first I tried adding

    // Registers enabled bundles
    BundleConfig.RegisterBundles(BundleTable.Bundles);

    // Dependency injection
    AutofacConfig.ConfigureContainer();

as documentation suggest, but i am getting the same error.

Any suggestions?Error screenshot

EDIT: I tried recommended solutions but they did not fix it. Global.asax and ApplicationConfig as follows:

Global.asax

ApplicationConfig

1

There are 1 best solutions below

0
On

It looks like you're not registering your Kentico "features".

Add a new .cs file called ApplicationConfig.cs under /App_Start folder. In there register your features like so:

public static void RegisterFeatures(IApplicationBuilder builder)
{
    // Enable required Kentico features

    builder.UsePreview();

    builder.UsePageBuilder(new PageBuilderOptions()
    {
        RegisterDefaultSection = true
    });

    builder.UseResourceSharingWithAdministration();

    RegisterPageTemplateFilters();
}

    private static void RegisterPageTemplateFilters()
    {
        //Enabled, This must be last
        //PageBuilderFilters.PageTemplates.Add(new EmptyPageTemplateFilter());

        //Disabled
        PageBuilderFilters.PageTemplates.Add(new NoEmptyPageTemplateFilter());
    }

Then in your Global.asax.cs Application_Start() add the following line above registering your routes/bundles:

ApplicationConfig.RegisterFeatures(ApplicationBuilder.Current);

This should resolve the issue you're having.