Cross cutting concerns in EPiServer using Dynamic Proxies

Cross cutting concerns should be handled in an unobtrusive way, i.e. implemented in a way they don’t require any modifications to your original features. One way to achieve this is by using Aspect Oriented Programming, more specifically using Castle Dynamic Proxies to intercept method calls at runtime with StructureMap. The code examples below were implemented in an EPiServer Alloy MVC site. In this example we’re going to add MiniProfiler and measure how long each method takes to run.

Debug EPiServer Search (lucene)

A quick note to self: To debug EPiServer Search indexing, the below should be added to EPiServerlog.config:   <!--EPiServer.Search.IndexingService.IndexingService--> <logger name="IndexingService"> <level value="All" /> </logger> <logger name="EPiServer.Search"> <level value="All" /> </logger> <!-- Reduce amount of debug logging --> <logger name="EPiServer.Core.ContentProvider" additivity="false"> <level value="Debug" /> </logger> <logger name="EPiServer.Data.Dynamic.Providers.DbDataStoreProvider" additivity="false"> <level value="Error" /> </logger> <logger name="EPiServer.Data.Providers.SqlDatabaseHandler" additivity="false"> <level value="Error" /> </logger> <logger name="EPiServer.Data.Providers.ConnectionContext" additivity="false"> <level value="Error" /> </logger>  

EPiServer workflows – emails not being sent

The most commonly used workflow in EPiServer is the Sequential approval workflow. It is primarily used to assign tasks and send notifications through the various stages of page publication. Troubleshooting workflows is no easy task. You typically have to enable Windows Workflow Foundation diagnostics and examine the logs. You can achieve this by adding the following element to your web.config: <system.diagnostics> <switches> <add name="System.Workflow.Runtime" value="All" /> <add name="System.Workflow.Runtime.Hosting" value="All" /> <add name="

EPiServer remote events troubleshooting

EPiserver uses WCF to send and receive events between servers configured in a multi-server setup (load-balanced or enterprise). A site in a server will send events (publisher) to one or many sites in other servers (subscriber). This is an example of an enterprise setup, with one publishing server and two public facing web servers. To enable remote events (events between EPiServer sites), the following has to be enabled in your episerver.

EPiServer UDP remote events in secure environments

In a production environment access between various servers is usually restricted to what is the minimum required for the solution to operate. In an enterprise scenario it is common to find a setup where you have multiple load-balanced servers for public users and a separate publishing environment for web editors. These environments usually follow a “deny all” approach where all access has to be explicitly permitted. EPiServer by default uses UDP multicast to transmit event messages (e.

EPiServer DataFactory deadlock exception

Recently we faced a problem in one of our websites where some pages would randomly fail to load and a deadlock exception would be thrown from EPiServer.DataAccess.DatabaseFactory: “Failing because of deadlock.” At this point we suspected that some other process might be locking some rows out thus causing the loading of our page to fail. Drilling down the logs, we found out a bit more of what was causing the pages to fail: