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
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.