<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><language>en</language><title>Blog posts by Mathias Kunto's blog</title> <link>https://world.optimizely.com/blogs/Mathias-Kuntos-blog/</link><description></description><ttl>60</ttl><generator>Optimizely World</generator><item> <title>Updated Exception enrichment functionality for added safety</title>            <link>https://blog.mathiaskunto.com/?p=4394</link>            <description>Here is an improved version of the Exception enrichment functionality described in the article Enriching your exceptions with information from Episerver. Updates has been made in order to make it more robust in regards to usage of abstract classes that may in some cases throw NotImplementedException, causing the enrichment code to terminate.</description>            <guid>https://blog.mathiaskunto.com/?p=4394</guid>            <pubDate>Mon, 13 Oct 2025 19:39:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Allow only certain number of items in ContentAreas in Optimizely</title>            <link>https://blog.mathiaskunto.com/?p=4390</link>            <description>Here is a validation attribute that I wrote in order to limit the number of items that editors may put in Optimizely ContentAreas to a specific set of numbers, instead of having max and min values. The part that may be of interest to highlight is the possibility to skip validation in certain cases, for instance when combining the validation with the Hide-attribute discussed in the article Hiding and showing edit mode properties on same content type in Optimizely CMS depending on context. We need the validation on properties that previously was visible to all editors, but now are not. </description>            <guid>https://blog.mathiaskunto.com/?p=4390</guid>            <pubDate>Sun, 12 Oct 2025 08:51:19 GMT</pubDate>           <category>Blog post</category></item><item> <title>Hiding and showing edit mode properties on same content type in Optimizely CMS depending on context</title>            <link>https://blog.mathiaskunto.com/?p=4386</link>            <description>At my current client we have the need to hide or show properties for editors in Optimizely edit mode, on the same page type, depending on where/how the page type is used. Our structure consists of global pages, and local instances of the same pages. There are times when global editors should be able to edit properties, while local editors should not. Since we do not want to clutter the interface for the local editors, we simply hide the properties for them. The method we use is having our attribute implement the IMetadataAware interface, and then set the two properties </description>            <guid>https://blog.mathiaskunto.com/?p=4386</guid>            <pubDate>Sat, 11 Oct 2025 08:35:15 GMT</pubDate>           <category>Blog post</category></item><item> <title>Changing Optimizely property return type yields MissingMethodException on getter</title>            <link>https://blog.mathiaskunto.com/?p=4383</link>            <description>I was faced with a somewhat unexpected MissingMethodException changing a property type from string to XhtmlString while making changes to an Optimizely website for my current client. I&amp;#8217;ve done this sort of change on mant occations, and moving from a string to an XhtmlString should not cause a problem. The exception seemed to be thrown on a simple Html.PropertyFor call in the view file. This type of problem occurs when there is a binary mismatch, i.e. you have compiled code where you try to call the property getter, that is supposed to return a string, but now returns an XhtmlString. </description>            <guid>https://blog.mathiaskunto.com/?p=4383</guid>            <pubDate>Sat, 28 Jun 2025 13:48:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Object reference not set to an instance of an object in EPiServer.Shell.Web.Mvc.HttpContextBaseExtensions.SetCulture method</title>            <link>https://blog.mathiaskunto.com/?p=4377</link>            <description>I ran in to this problem setting up an older Optimizely website running on .Net Framework. The view mode of the website worked just fine, however, when trying to access the edit mode via /episerver/cms, the following exception was thrown. Getting at least some hints from the post Object Reference while trying to access epicms in local machine &amp;#8211; https://local.XXXX.com/episerver on the forum, I realized that I needed to ensure all of the required IIS features was activated. So you probably just need to activate ASP.NET 4.8 and .NET Extensibility 4.8 to get rid of this problem. Sorry for the </description>            <guid>https://blog.mathiaskunto.com/?p=4377</guid>            <pubDate>Sat, 14 Jun 2025 11:41:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Injecting Fragments in Optimizely XHtmlStrings</title>            <link>https://blog.mathiaskunto.com/?p=4367</link>            <description>Injecting fragments in Optimizely XHtmlStrings is quite easy using a custom display template to render the property. Here is an example on how you can inject custom data based on Optimizely blocks dropped in the XHtmlString property. I&amp;#8217;ve been using an approach similar to this to inject ids used for anchor tag navigation also within free text. The interesting thing in the custom display template is the call to the inject fragments method. In the InjectFragments method, we will create a new XhtmlString object containing our manipulated fragments. As we are working with blocks dropped in the XhtmlString by the </description>            <guid>https://blog.mathiaskunto.com/?p=4367</guid>            <pubDate>Mon, 24 Jun 2024 19:43:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Clearing output cache in a multi server environment</title>            <link>https://blog.mathiaskunto.com/?p=4229</link>            <description>This is a follow up to the previous Acting on Optimizely Remote Events article. While still working with the older Optimizely 11 you may rely on the Remote Event functionality to clear cache. However, in some cases you may need to build on this functionality to clear the output cache on other servers manually. In a previous project we used this to clear the cache of virtual pages (i.e. we had a single Optimizely page instance which presented different information based on a custom id number, together with a friendly URL rewriting functionality). This first method is to be called </description>            <guid>https://blog.mathiaskunto.com/?p=4229</guid>            <pubDate>Sat, 25 May 2024 17:17:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Prevent certain Optimizely visitor groups from being used in content areas</title>            <link>https://blog.mathiaskunto.com/?p=4238</link>            <description>At my current client we had the need to prevent the use of certain visitor groups in some of the content areas. I.e. some areas were only to support national content, and other areas only regional content (where each region had a different visitor group). Here is a solution making use of ValidationAttribute. The visitor group ids are kept in the ContentAreaItem&amp;#8217;s AllowedRoles property. The attribute may be used on any ContentArea property as below. Of course, allowing or disallowing both national and regional content at the same time makes no sense.</description>            <guid>https://blog.mathiaskunto.com/?p=4238</guid>            <pubDate>Sat, 14 Oct 2023 16:03:15 GMT</pubDate>           <category>Blog post</category></item><item> <title>System.Data.SqlClient.SqlException: Invalid column name ‘IsApproved’, ‘IsLockedOut’, ‘Comment’, ‘CreationDate’, ‘LastLoginDate’, ‘LastLockoutDate’</title>            <link>https://blog.mathiaskunto.com/?p=4223</link>            <description>Got this SqlException again moving a database from a client&amp;#8217;s production environment into development. Thought I&amp;#8217;d write a short note on resolving it. Check the migration history table: It is likely that the initial create of the tables used Microsoft.AspNet.Identity.EntityFramework.IdentityUser instead of the expected EPiServer.Cms.UI.AspNetIdentity.ApplicationUser. The ContextKey column would contain EPiServer.Cms.UI.AspNetIdentity.ApplicationDbContext`1  rather than EPiServer.Cms.UI.AspNetIdentity.ApplicationDbContext`1 . This may be resolved by removing the tables dbo.__MigrationHistory (or just the row with the identity migration if there are others), dbo.AspNetUserClaims, dbo.AspNetUserLogins, dbo.AspNetUserRoles, dbo.AspNetRoles, dbo.AspNetUsers. Then restarting the Optimizely application and attempting to login to the admin/edit interface. Of course, any data in </description>            <guid>https://blog.mathiaskunto.com/?p=4223</guid>            <pubDate>Sat, 17 Jun 2023 21:36:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Acting on Optimizely Remote Events</title>            <link>https://blog.mathiaskunto.com/?p=4227</link>            <description>Just a short piece on how to act on Optimizely&amp;#8216;s remote events. While in later versions you may use for instance RabbitMQ or ActiveMQ, still being on 11 will have you using the older event distribution. For attaching your own handlers to the received event, you will need to get an instance of the IEventProviderAccessor rather than accessing events directly like with publish events via IContentEvents. Optimizely have plenty of their own events, so you&amp;#8217;ll need to filter on what you&amp;#8217;re interested in.</description>            <guid>https://blog.mathiaskunto.com/?p=4227</guid>            <pubDate>Sat, 20 May 2023 11:37:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Using ActiveMQ with Optimizely 12</title>            <link>https://blog.mathiaskunto.com/?p=4205</link>            <description>Whilst setting up Optimizely 12 to work with RabbitMQ is rather straight forward, making it use ActiveMQ for transport instead requires a bit more configuration on our part. Here is a short article on how to set up Optimizely 12 to use MassTransit (EPiServer.Events.MassTransit) with ActiveMQ. For a short instruction on how to set up a local ActiveMQ server, please see Muthu Kumaran&amp;#8216;s article on How to use ActiveMQ in C#. Settings up Optimizely to use ActiveMQ requires a bit of settings. Here is an example on what you can add to your appsettings.Development.json. Since Optimizely will be setting up </description>            <guid>https://blog.mathiaskunto.com/?p=4205</guid>            <pubDate>Thu, 16 Mar 2023 20:58:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>ActiveMQ tester application with topic support</title>            <link>https://blog.mathiaskunto.com/?p=4199</link>            <description>I&amp;#8217;ve updated the ActiveMQ tester application with topic support as it is required by the Optimizely on-prem event provider (EPiServer.Events.MassTransit). Otherwise, the usage is as before (see ActiveMQ connection tester application). Source code at GitHub.</description>            <guid>https://blog.mathiaskunto.com/?p=4199</guid>            <pubDate>Thu, 16 Mar 2023 11:15:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>ActiveMQ connection tester application</title>            <link>https://blog.mathiaskunto.com/?p=4197</link>            <description>While moving our client&amp;#8217;s Optimizely 12 website to a new hosting provider we had to abandon our RabbitMQ installation in favour of a new ActiveMQ one, also supported by the on-prem event provider (EPiServer.Events.MassTransit). To make it easier setting this up I rewrote the old RabbitMQ connection tester application into a new one working with ActiveMQ. Source code and executable are available at GitHub. To use you will have to update appsettings.json with proper values. The sender may be started in a command prompt by typing: and the receiver:</description>            <guid>https://blog.mathiaskunto.com/?p=4197</guid>            <pubDate>Fri, 10 Jun 2022 17:24:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Episerver Remote Events tester console application for framework 4.8 and Optimizely 11</title>            <link>https://blog.mathiaskunto.com/?p=4194</link>            <description>My current client is moving their Optimizely 11 websites to a new hosting provider and we need an easy way to test the remote event replication system. I remember that there was an old console application for this back in the day, but when I found a copy of it I realized that it required .net 2.0 to function. I shamelessly disassembled the application and stole the code (I can&amp;#8217;t find out who created it though, sorry) in order to upgrade it a bit. Here is a quick version made for .net framework 4.8 and the Optimizely 11 assemblies. I&amp;#8217;m </description>            <guid>https://blog.mathiaskunto.com/?p=4194</guid>            <pubDate>Sat, 28 May 2022 10:40:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>RabbitMQ connection tester application</title>            <link>https://blog.mathiaskunto.com/?p=4180</link>            <description>We set up Optimizely&amp;#8216;s new on-prem event provider (EPiServer.Events.MassTransit) for my current client&amp;#8217;s Optimizely 12 website the other week. At current date it is still in beta until there are enough uses for there to be a production release. For the mass transit we set up RabbitMQ. For earlier Optimizely (Episerver) versions built on ASP.NET Framework there was a tool for testing the event replication between servers. I couldn&amp;#8217;t find anything similar for helping us test the RabbitMQ set up, so I created a simple console application for this. Source code and the executable are available at GitHub. To use, </description>            <guid>https://blog.mathiaskunto.com/?p=4180</guid>            <pubDate>Sun, 20 Feb 2022 14:43:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Simple way to use enums for sorting in Optimizely Search &amp; Navigation</title>            <link>https://blog.mathiaskunto.com/?p=4160</link>            <description>As stated in the Optimizely Search &amp;#38; Navigation developer documentation on Sorting, &amp;#8220;Sorting is supported for numerical types such as int,&#160;double, DateTime, and string&amp;#8221;. This means that you will get an error from EPiServer.Find.SortingValidationHelper.ValidateSupportedType if you attempt to sort on an enum field. There are of course various solutions to this problem, but here is a rather simple one: turn the enum into a string and use that for sorting instead. TheEnumString will be calculated when Optimizely Search &amp;#38; Navigation index the page. A simple method call like this in a getter is OK. However, if you start doing more </description>            <guid>https://blog.mathiaskunto.com/?p=4160</guid>            <pubDate>Sat, 12 Feb 2022 09:57:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Finding the latest Optimizely Search &amp; Navigation’s client Javascript URL</title>            <link>https://blog.mathiaskunto.com/?p=4150</link>            <description>I got a question on how to find the latest version of the Search &amp;#38; Navigation /epi-util/find.js script file after publishing the article Proxy for Optimizely Search &amp;#38; Navigation tracking script. It is really quite simple, if you look at how Optimiezely does things. The solution is to make use of the built-in IPathHelper (namespace EPiServer.Find.UI.Helpers). Optimizely&amp;#8217;s default GetClientResourceBasePath implementation essentially makes a request to https://dl.episerver.net/version.json which just returns the current version.</description>            <guid>https://blog.mathiaskunto.com/?p=4150</guid>            <pubDate>Sun, 06 Feb 2022 08:15:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Proxy for Optimizely Search &amp; Navigation tracking script</title>            <link>https://blog.mathiaskunto.com/?p=4132</link>            <description>When using Optimizely Search &amp;#38; Navigation (previously Episerver Find) you will automatically get a reference to a client side Javascript injected into your markup. Occationally, you may want to proxy it via your Optimizely website&amp;#8217;s backend, caching it or just make it appear as if it comes from your own domain. It may also be a way of avoiding false positives in regards to script tags not using Subresource Integrity (SRI) hashes where you control the script location yourself. The ExternalResourceService is just a simple disposable class making the call to retireve the client side script, then returning it as </description>            <guid>https://blog.mathiaskunto.com/?p=4132</guid>            <pubDate>Thu, 03 Feb 2022 17:18:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Getting the root PageReference of the imported pages in Episerver</title>            <link>https://blog.mathiaskunto.com/?p=4113</link>            <description>In our work to automate export and import of the production database into our test environment we had to maintain a test node in the Episerver page tree. This ment that we had to export it before replacing the database, and then import it again. Please see Exporting Episerver content programmatically through an ApiController and Importing Episerver content programmatically through an ApiController for information about this. In order for our export functionality to know the node to export, we had to maintain information about its whereabouts. We keep this data stored in a PageReference property on our settings page. However, </description>            <guid>https://blog.mathiaskunto.com/?p=4113</guid>            <pubDate>Mon, 19 Apr 2021 19:16:00 GMT</pubDate>           <category>Blog post</category></item><item> <title>Importing Episerver content programmatically through an ApiController</title>            <link>https://blog.mathiaskunto.com/?p=4104</link>            <description>Importing the test node package that we exported earlier (see article Exporting Episerver content programmatically through an ApiController) would be the next step in our automated transfer of the production database to the testing environment. I extended our ApiController with an import endpoint for this purpose. Note that this code is never intended to be deployed to production. Importing is easier than exporting. The relevant Episerver interface IDataImporter is not disposable. We will still use the ServiceLocator to get an instance as the default implementation may cause issues if we were to reuse it in our singleton ImportExportService. There are </description>            <guid>https://blog.mathiaskunto.com/?p=4104</guid>            <pubDate>Sun, 18 Apr 2021 07:58:00 GMT</pubDate>           <category>Blog post</category></item></channel>
</rss>