0

This is how the Helix example is structured and I'm trying to understand it.

enter image description here

The *.rendering in the Project layer looks like an ASP.NET Core template but the *.rendering projects in the Feature layer look like Class Library/Console App. Why is it different?

Please let me know what should be the template for creating the *.rendering & *.platform projects (e.g. Console app, MVC app, .Net core app, class library etc).

I understand the purpose of Feature, Foundation & Project layers. But for developing a Headless architechture with .Net core Rendering SDK, I'm unable to understand what should be in the *.platform & what should be in *.rendering.

1 Answer 1

3
+50

As I learned during the Sitecore 10 development, there are two kinds of projects we use while Developing with the ASP.NET Core Rendering SDK. They are as follows.

  • RenderingHost project: It is the primary project and is considered the startup project which will run when debugging in Visual Studio. The RenderingHost project is also where you’ll be creating models and views necessary to support custom components. The Startup.cs class within the Rendering project is also where these views can be registered for use within Sitecore.

  • Platform project: Corresponds to the Content Management container and contains the code and configuration for that part of the Sitecore platform. To deploy any code changes to the configuration, assemblies, or content, this project will need to be published from Visual Studio. If changes are made to the Platform project, debugging is an optional, but recommended step. To debug the Platform project, you will need to attach it to the w3wp process within the Content Delivery container.

Now the architecture you are following is a Helix based architecture and you can see feature and foundation folders.

I hope I can answer your questions.

As mentioned in the RenderingHost project, it contains a startup.cs file that is used to register the views. So you can see in the BasicCompany.Project.BasicCompany.Rendering, they are using all the features *.rendering projects under the Dependencies

enter image description here

And registering them into the Startup.cs file using this statement.

  // Register the Sitecore Rendering Engine services.
        services.AddSitecoreRenderingEngine(options =>
        {
            //Register your components here
            options
                .AddFeatureBasicContent()
                .AddFeatureNavigation()
                .AddFeatureProducts()
                .AddFeatureServices()
                .AddDefaultPartialView("_ComponentNotFound");
        })

So the summary is that Model-bound components supported by a model and view must be registered within the Startup.cs class to be used in the rendering host. Thats' why they are being used as Dependencies under the BasicCompany.Project.BasicCompany.Rendering project and all the Platform projects are associated with their feature project. I think you need to use the same pattern as you get from the sample project.

I hope this makes sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.