Søren Kruse | Sitecore and .NET

  1. Sitecore 9 rule-based configuration and numbered roles

    Use numbered role definitions for easier configuration of multiple Sitecore servers with the same role.…

  2. Sitecore release notes made searchable!

    If you're like me you've probably (more than once) had to read/search through several pages of release notes to find out if the issue you are currently having (or a bug you have reported earlier) has been fixed in any of the latest Sitecore releases. Well, at some point…

  3. Sitecore 9 with Solr and SQL Server running in Docker

    With Solr now being the default and recommended search provider in Sitecore 9 for all setups except XM1 (and required for xConnect) I wanted to look at how to run Solr with Docker. My requirements/reasons for wanting to run Solr in a Docker container: Not having to install Java…

  4. MongoDB, C# and DateTimeOffset

    The MongoDB driver for C#/.NET can currently be serialized/deserialized in three different ways - as an array, object or string. You can control the BSON representation of your property by adding the [BsonRepresentation] attribute or set it on your class map. [BsonRepresentation(BsonType.String)] public DateTimeOffset EventStart { get;…

  5. Octopus C# script step not finishing unawaited async Tasks

    You might find yourself wanting to start an async Task either through Task.Run(() => ...) or something like Task DoSomethingAsync() or Task.Delay() where you don't want to await the completion of the task. You just want the step to complete and the task to continue running in the background.…

  6. ErgastApiClient - C# library for querying the Ergast Developer API (Formula 1 data)

    The Ergast Developer API (http://ergast.com/mrd/) is an awesome (experimental) web service which provides a historical record of Formula 1 data for non-commercial purposes. The API contains data all the back to the beginning in 1950. Some time ago I wanted to query some of this data and…

  7. Octopus Script Step Error: "Common Language Runtime detected an invalid program"

    You might run into the following error when deploying with Octopus and one of your tasks is executing a C# script (ScriptCS) on the target machine. ERROR: Script execution failed. [InvalidProgramException] Common Language Runtime detected an invalid program. Exit code: 1 The remote script failed with exit code 1 This…

  8. Filtering index searches by item security with correct paging and total results count

    Sitecore ContentSearch indexes does not check item security by default, but it can be enabled with a configuration setting by changing the value of /sitecore/contentSearch/indexConfigurations/defaultSearchSecurityOption from DisableSecurityCheck to EnableSecurityCheck. However, it does not really work with paging of the results (i.e skip/take) or the total…