Sitecore 9 Caching – Sitecore.Caching.CacheManager.GetAllCaches() changed...
With the increased use of dependency injection, in Sitecore, some classes do no longer return concrete classes, but interfaces instead. You therefore need to change your code, if you use the...
View ArticleSitecore check access and roles programatically
The Sitecore security model have changed over time, but the general API to check security access and roles have been stable for many many years. CHECK IF USER HAS ACCESS TO AN ITEM: To check if a user...
View Articlec# Async fire and forget
Often in application development you want a process to call another thread and continue the process flow, without waiting for a response from the called thread. This pattern is called the “fire and...
View ArticleAzure Application Insights – Multiple services from same server
This trick enables you to have multiple services from the same server log to the same Application Insights instance, and at the same time distinguish between each service. Application Insights...
View ArticleSitecore Security: Roles in Roles – What it is and how it works
The Sitecore Roles-In-Roles is an extension to the basic authorization that have been around ever since Sitecore 5. WHAT IS ROLES-IN-ROLES? Roles-In-Roles allows you to have nested roles, so when you...
View ArticleSQL Cannot resolve the collation conflict between “xxx” and “xxx” in the...
When joining 2 tables from different databases, the following error might occur: Cannot resolve the collation conflict between “SQL_Latin1_General_CP1_CI_AS” and “Danish_Norwegian_CI_AS” in the equal...
View ArticleUsing emojis in Sitecore
Because people younger than me stopped communicating with words and instead adopted a modern version of hieroglyphs, emojis have become a part of every modern OS and Browser, and have even been adopted...
View ArticleImprove Sitecore Experience Editor Performance by Disabling Number of Locked...
The Sitecore Experience Editor is not the fastest tool in the shed, but you can improve the performance slightly by disabling the counter on the “My items” button that shows how many items you...
View ArticleSitecore create packages using PowerShell
The Sitecore PowerShell Extensions is a very powerful module what allows you to automate a lot of the trivial Sitecore tasks. The Export-Package command will create a Sitecore package. This script will...
View ArticleAzure ApplicationInsights track custom metrics using the TelemetryClient
The Microsoft.ApplicationInsights nuget package is your code gateway to the Microsoft Application Insights portal, and also to the Azure Monitor universe. You use these tools as a shared place for your...
View ArticleSerilog – Add thread ID to the log file
Serilog is more or less the default file logger when developing .NET Core applications. The simple logger can easily be modified to – for example – add the thread ID. FIRST THINGS FIRST: THE SERILOG...
View ArticleSitecore delete old item versions
Are your Sitecore editors version-trigger-happy? Is your master database items drowning in old versions that will never be used – or is just exact replicas of the previous version? Many versions of the...
View ArticleSitecore disable automatic lock on create items
From Sitecore 9, Sitecore changed the default behavior when creating items in the content editor. As per default, any item is locked when created, and will only be unlocked if the user unlocks it, or...
View ArticleYour session ID is being reused and there is nothing you can do about it
In many years we have been used to the fact that the ASP.Net session ID uniquely identifies one session, and one session only. Back in 2006, Margaret Rouse from TechTarget even wrote in the definition...
View ArticleSitecore Pipelines – The great walkthrough
I have previously stated my enthusiasm for the Sitecore Pipeline concept. This article describes how to create your own, how to add parameters, and which properties to use. WHAT IS A SITECORE PIPELINE?...
View ArticleRead blob file from Microsoft Azure Storage with .NET Core
In order to read a blob file from a Microsoft Azure Blob Storage, you need to know the following: The storage account connection string. This is the long string that looks like this:...
View ArticleRead from Azure Queue with Azure WebJobs 3.0 and .NET Core
From WebJobs 2.0 to WebJobs 3.0 Microsoft have completely rewritten the way Azure WebJobs is used. The reasons are probably noble, but they require you to redo your work when upgrading. So I made this...
View ArticleDeserialize XML array to string[] and how to allow JSON to be deserialized...
How do you deserialize the classic XML array to an string[] type? The XML representation of an array is a list of elements: <?xml version="1.0" encoding="UTF-8"?> <root> <MyXml>...
View ArticleSitecore get Context from fully qualified URL
One of the basic Sitecore concepts is the concept of a context. The context is resolved from the HTTP Context to Sitecore and determines the database, language, user domain, content start item etc. The...
View ArticleCreate Sitecore items using PowerShell
You can use the Sitecore PowerShell Extensions for many trivial tasks. This script creates a “components” folder below all items from a root item: // Get the root item $root = Get-ChildItem -Path...
View Article