Category Archives: c#

Sitecore and Feature Flags using LaunchDarkly

Feature flags are a software development best practice of gating functionality. Functionality can be deployed “off”, then turned on via the feature flag, separate from deployment. With feature flags, you can manage the entire lifecycle of a feature. Launchdarkly.com In … Continue reading

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

Get Sitecore System Info

Would you like to know the System Info of your current Sitecore instance: It’s fairly easy. I created an SysInfo.aspx page and dumped in into the /sitecore modules/shell folder. The page is now available on the URL <yourwebsite>/sitecore modules/shell/sysinfo.aspx. The … Continue reading

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

Send email via SparkPost and C#

SparkPost is yet another email service. It is easy to work with, seems robust, and it will be fairly easy on your client’s budget, as you get 100.000 emails per month for free (as per jan 2017). A SparkPost email … Continue reading

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

Sitecore custom cache that is cleared on publish

In this article I will demonstrate how to create a custom Sitecore cache and how to ensure that it is cleared when you publish. First I will create the simplest custom cache available: The cache is instantiated with a name, … Continue reading

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

Sitecore General error when submitting contact – Another contact with the same identifier already exists

In Sitecore when creating your own contacts you can get the following exception: 10604 10:16:27 ERROR General error when submitting contact. Exception: System.InvalidOperationException Message: Another contact with the same identifier already exists. Source: Sitecore.Analytics.MongoDB at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDataAdapterProvider.SaveContactWithIdentifier(IContact contact, ContactSaveOptions saveOptions) at … Continue reading

Posted in .net, c#, General .NET, Sitecore 8 | Tagged , , , , , | 1 Comment

Sitecore Advanced Configuration in .config files

Sitecore allows you to create configuration sections in /configuration/sitecore/ that consists of hierarchies of configurations including lists, and it will even help you serialize the configuration to object instances. Observe the following real life example of a configuration I created to … Continue reading

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

Sitecore get host name from a different context

Ohno, you are running in one context, say the “shell” context, and all of your URL’s have to point to the “website” context. The hustler will obviously hard-code the domain name of the “website” into the code. But the Sitecore … Continue reading

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

Sitecore EXM: Send an email from code

The Sitecore Email Experience Manager is your way to send personalized emails to Sitecore users.   You do not need to send bulk emails, you can easily send single emails with contents like “Here is your new password” or “Your … Continue reading

Posted in c#, General .NET, Sitecore 8 | Tagged , , , , , | 2 Comments

Sitecore xDB – flush data to MongoDB

When debugging Sitecore xDB issues, it is a pain that data is not written to MongoDB directly, but you have to wait for your session to end. The legend said that you could either set the session timeout to 1 … Continue reading

Posted in c#, General .NET, Sitecore 8 | Tagged , , , | 4 Comments

Sitecore sublayout caching vary by cookie

In Sitecore you can control the caching of your sublayouts in many different ways. Checking the “Cacheable” box allows you you vary the cache by data (data source), device, login (anonymous users have a different cached version from named users), … Continue reading

Posted in c#, General .NET, Sitecore, Sitecore 5, Sitecore 6, Sitecore 7, Sitecore 8 | Tagged , , , | 1 Comment