Author Archives: briancaos

About briancaos

Developer at Pentia A/S since 2003. Have developed Web Applications using Sitecore Since Sitecore 4.1.

C# Lists in Lists – Getting all inner values, or the unique inner values

Getting the inner value of a list inside a list can seem complicated in C#, but LINQ makes it easier. But first let’s make a list in a class, and then make a list of the class with the list … Continue reading

Posted in .net, c#, General .NET | Tagged , , | Leave a comment

Sitecore create custom Content Editor Warnings using Conditions and Rules

The Content Editor Warnings are these yellow boxes that hover over your content in the Content Editor in Sitecore: In the old days we would make them by hooking into the getContentEditorWarnings pipeline. Nowadays we use the Sitecore Rules engine. … Continue reading

Posted in c#, General .NET, Sitecore 5, Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , , , , , | Leave a comment

Sitecore poor Index Update performance linked to missing Index in the Links database

Suddenly my index updates took forever to finish. I mean, one index update would take 2 minutes. And I have a lot of index updates. A lot. UPDATE: 2022-01-19: Sitecore have suggested the same changes to the links database in … Continue reading

Posted in General .NET, Sitecore, Sitecore 5, Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , , | 2 Comments

C# and Microsoft.ML. Removing words from sentence. Getting started with Machine Learning

Microsoft.ML is the NuGet package for ML.Net, Microsoft’s open-source Machine Learning framework. In this introduction I will create a stopword engine, capable of removing unwanted words from a sentence. I know that it is overkill to use machine learning to … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , | Leave a comment

Sitecore high CPU usage – is the SQL Session State Provider the villain?

My massive Sitecore 9.1 installation started having CPU spikes, even when the servers did not seem to receive more requests. When CPU spiked, I could see that the requests queue would build up, until it crashed with the following error: … Continue reading

Posted in Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , , | Leave a comment

Run parallel tasks in batches using .NET Core, C# and Async coding

If you have several tasks that you need to run, but each task takes up resources, it can be a good idea to run the tasks in batches. There are a few tools out there, and one of them is … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , | Leave a comment

C# Working with Namespaces in XDocument and XML

XDocument is your old XML friend in C#, and it allows you to create or manipulate XML documents. To work with namespaces, you must use the XNamespace class. This is an imaginary XML document (a Google Merchant Feed formatted one) … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , | Leave a comment

Why Sitecore Composable DXP is great news for developers and consultants

Sitecore announced that they will embrace the Composable DXP approach. DXP is, according to Gartner: A digital experience platform (DXP) is an integrated set of core technologies that support the composition, management, delivery and optimization of contextualized digital experiences. Gartner … Continue reading

Posted in Sitecore, Sitecore 8, Sitecore 9 | Tagged , , | Leave a comment

Write to SOLR from .NET Core

.NET Core supports the SOLR index through the SolrNet.Core NuGet packages. Here is how you update the index. STEP 1: THE NUGET PACKAGES You need the following NuGet packages: SolrNet.Core SolrNet.Microsoft.DependencyInjection STEP 2: CREATE A MODEL CLASS CONTAINING THE PROPERTIES … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , | Leave a comment

Sitecore publishItem pipeline – handling missing delete when publishing

When publishing items in Sitecore, the publishItem pipeline is called for each item that must be published, or unpublished. Except for children of items that have been deleted. Let’s take this example: If I publish the top item, the publishItem … Continue reading

Posted in c#, General .NET, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , , | Leave a comment