Setting up my first Sitecore .NET CORE Website

Hello, before start setting up, I would recommend watching the following presentation .

After you get the theory, it’s time start to get started

The Helix – ASP .NET CORE is an excellent way to start your journey thought .NET CORE , the example is good, and can give you a good idea

Using docker can have many issues, so I recommend using the link below in case you run into a few

https://errorcotidianam.wordpress.com/2021/09/14/sitecore-docker-common-issues-on-installation/

Go to https://github.com/Sitecore/Helix.Examples and download the zip

First :STOP IIS, AND STOP SOLR, Disconnect VPN !

Extract the zip

go to the following folder : C:\Helix.Examples-master\examples\helix-basic-aspnetcore

Open powershell in administrative mode and run

./Init1.sp1

You will some something very similar to the image below

Now lets run another command

./up.sp1

On your hosts, you will see the new following entries,keep in mind we will use those URLs to access our website

127.0.0.1 cd.basic-company-aspnetcore.localhost
127.0.0.1 cm.basic-company-aspnetcore.localhost
127.0.0.1 id.basic-company-aspnetcore.localhost
127.0.0.1 http://www.basic-company-aspnetcore.localhost

Site will be up and now it will publish the compiled code to our machines

Now Let’s monitor the rendering host

By monitoring our rendering host, we can see the calls being made from the rendering host to OUR CD Server.

docker-compose logs -f rendering

Below, we can identify a call that is being made to the CD Server

we can also make our own call and see the result

unformatted result

{"sitecore":{"context":{"pageEditing":false,"site":{"name":null},"pageState":"normal","language":"en","itemPath":"/"},"route":{"name":"Home","displayName":"Home","fields":{"NavigationTitle":{"value":"Home"},"FooterCopyright":{"value":"Copyright"},"HeaderLogo":{"value":{"src":"https://cd.basic-company-aspnetcore.localhost/-/media/Basic-Company/helix-logo.png?h=44&iar=0&w=139&hash=0A1AD60DFDAA0C78DD1BE4928E2659D8","alt":"Sitecore Helix","width":"139","height":"44"}}},"databaseName":"web","deviceId":"fe5d7fdf-89c0-4d99-9aa3-b5fbd009c9f3","itemId":"97479c6b-bb30-4a15-afd1-2c89f207e9d6","itemLanguage":"en","itemVersion":1,"layoutId":"4ed48317-062f-4465-b9af-1e636841525b","templateId":"63cd29ba-0e08-44d5-ab10-e05298a9818d","templateName":"Home Page","placeholders":{"header":[{"uid":"7d4f689f-208c-4ea3-88ba-0bc6e615771e","componentName":"Header","dataSource":"","params":{},"fields":{"logoLink":{"NavigationTitle":{"value":"Home"},"FooterCopyright":{"value":"Copyright"},"HeaderLogo":{"value":{"src":"https://cd.basic-company-aspnetcore.localhost/-/media/Basic-Company/helix-logo.png?h=44&iar=0&w=139&hash=0A1AD60DFDAA0C78DD1BE4928E2659D8","alt":"Sitecore Helix","width":"139","height":"44"}}},"navItems":[{"url":"/en/","isActive":true,"title":"Home"},{"url":"/en/Products","isActive":false,"title":"Products"},{"url":"/en/Services","isActive":false,"title":"Services"}]}}],"main":[{"uid":"bb562955-2cf5-4a57-b6c7-ddf2278ec0e0","componentName":"HeroBanner","dataSource":"{9C581356-66D4-4993-BB25-757B710A06E8}","params":{},"fields":{"Title":{"value":"Basic Company"},"Image":{"value":{"src":"https://cd.basic-company-aspnetcore.localhost/-/media/Basic-Company/hero-home.jpg?h=510&iar=0&w=1920&hash=39B9AA7BB85B6F4675A6F5BE0046B9AB","alt":"Basic Company","width":"1920","height":"510"}},"Subtitle":{"value":"Lorem Ipsum Dolor Sit Amet"}}},{"uid":"e10e7525-8542-41bc-939e-3082925b9c52","componentName":"PromoContainer","dataSource":"","params":{},"placeholders":{"promos":[{"uid":"6b3e9f3e-18eb-4321-9b1b-45e12b29b103","componentName":"PromoCard","dataSource":"{E74405CA-A09B-468C-AF74-5FFBD6CDBAED}","params":{},"fields":{"Image":{"value":{"src":"https://cd.basic-company-aspnetcore.localhost/-/media/Basic-Company/promo-card-1.jpg?h=1028&iar=0&w=1920&hash=B65B9C7A22B8FB140B9B48D264F4F9D5","alt":"Paperclip","width":"1920","height":"1028"}},"Text":{"value":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris congue vulputate erat hendrerit tincidunt.</p>"},"Link":{"value":{"href":"/en/","text":"","linktype":"internal","url":"","anchor":"","title":"","class":"","querystring":"","target":"","id":"{97479C6B-BB30-4A15-AFD1-2C89F207E9D6}"}},"Headline":{"value":"Lorem Ipsum"}}},{"uid":"a19a07d9-72e1-42b1-a110-4fbb52552ff7","componentName":"PromoCard","dataSource":"{3A379769-80C2-496C-8B00-31154B530739}","params":{},"fields":{"Image":{"value":{"src":"https://cd.basic-company-aspnetcore.localhost/-/media/Basic-Company/promo-card-3.jpg?h=1028&iar=0&w=1920&hash=BE365F4DED8ACB72831DE5024353A5EC","alt":"Paperclip","width":"1920","height":"1028"}},"Text":{"value":"<p>Ut a nisl id ante tempus hendrerit. Nam adipiscing. In auctor lobortis lacus. In auctor lobortis lacus. In hac habitasse platea dictumst.</p>"},"Link":{"value":{"href":"/en/","text":"","linktype":"internal","url":"","anchor":"","title":"","class":"","querystring":"","target":"","id":"{97479C6B-BB30-4A15-AFD1-2C89F207E9D6}"}},"Headline":{"value":"Dolor Sit"}}},{"uid":"67101942-6f27-4894-b407-3144cdc7a1e7","componentName":"PromoCard","dataSource":"{4ADD5536-81FA-4C38-B5AA-7836423FD9F9}","params":{},"fields":{"Image":{"value":{"src":"https://cd.basic-company-aspnetcore.localhost/-/media/Basic-Company/promo-card-4.jpg?h=1028&iar=0&w=1920&hash=C8BA2E62ECD5E83369D234905B22242A","alt":"Paperclip","width":"1920","height":"1028"}},"Text":{"value":"<p>Vivamus elementum semper nisi. Nulla neque dolor, sagittis eget, iaculis quis, molestie non, velit. Phasellus dolor.</p>"},"Link":{"value":{"href":"/en/","text":"","linktype":"internal","url":"","anchor":"","title":"","class":"","querystring":"","target":"","id":"{97479C6B-BB30-4A15-AFD1-2C89F207E9D6}"}},"Headline":{"value":"Nullam vel"}}}]}},{"uid":"d65c5c87-61b0-4e2d-9842-6d6b1faed3cf","componentName":"SectionHeader","dataSource":"{086CBC66-2B60-4711-BEE5-14C11181FB27}","params":{},"fields":{"Text":{"value":"Section Header"}}},{"uid":"0b6b5e57-eb1c-42a6-86f3-da06dfd1f319","componentName":"PromoContainer","dataSource":"","params":{},"placeholders":{"promos":[{"uid":"89e51b5a-164e-4d35-a8a8-de8a90e0ef8a","componentName":"PromoCard","dataSource":"{1014CEEE-6871-425F-9CA7-C1B91FA1FE47}","params":{},"fields":{"Image":{"value":{"src":"https://cd.basic-company-aspnetcore.localhost/-/media/Basic-Company/promo-card-5.jpg?h=1028&iar=0&w=1920&hash=F90008EE0E25BE896B65531ED5C64684","alt":"Sed mollis","width":"1920","height":"1028"}},"Text":{"value":"Praesent congue erat at massa."},"Link":{"value":{"href":"/en/","text":"","anchor":"","linktype":"internal","class":"","title":"","querystring":"","id":"{97479C6B-BB30-4A15-AFD1-2C89F207E9D6}"}},"Headline":{"value":"Etiam ultricies"}}},{"uid":"37626e09-3015-4350-b168-e3497bd52186","componentName":"PromoCard","dataSource":"{A994DEE7-8CEA-4213-B546-7E10CEDA74C2}","params":{},"fields":{"Image":{"value":{"src":"https://cd.basic-company-aspnetcore.localhost/-/media/Basic-Company/promo-card-2.jpg?h=1028&iar=0&w=1920&hash=C5CC64BCD692239C72FAA2AE53ACEDD1","alt":"Donec id","width":"1920","height":"1028"}},"Text":{"value":"Praesent blandit laoreet nibh. Fusce vel dui."},"Link":{"value":{"href":"/en/Products","text":"","anchor":"","linktype":"internal","class":"","title":"","querystring":"","id":"{AF068B22-D7AE-4A91-839B-DD15A9E76554}"}},"Headline":{"value":"Nunc nulla"}}}]}}],"footer":[{"uid":"66b647e6-3d33-45ef-af06-ebb2175bc56b","componentName":"Footer","dataSource":"","params":{},"fields":{"footerText":"Copyright"}}]}}}}

Open the follow URL and see the website!

https://www.basic-company-aspnetcore.localhost

Product list Page

Done !

Issues :

By running for the first time, you probably dont have the dependency installed open the link below and look for “.NET Core 3.1 SDK (v3.1.416)” download , install and have fun

https://dotnet.microsoft.com/en-us/download/visual-studio-sdks

.net core dependency is not installed

Restoring Sitecore CLI…
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:

  • You intended to execute a .NET program:
    The application ‘tool’ does not exist.
  • You intended to execute a .NET SDK command:
    A compatible installed .NET SDK for global.json version [3.1.412] from [C:\src\SUG-BR\Helix.Examples-master\examples\helix-basic-aspnetcore\global.json] was not found.
    Install the [3.1.412] .NET SDK or update [C:\src\SUG-BR\Helix.Examples-master\examples\helix-basic-aspnetcore\global.json] with an installed .NET SDK:
    5.0.404 [C:\Program Files (x86)\dotnet\sdk]