---
title: Create an initialization module
slug: cms-13/docs/create-an-initialization-module
docTags: 
createdAt: 2026-07-30T20:22:10.689Z
---

When you create your initialization module, add a reference to `EPiServer.Framework.dll`. The following initialization code example sets up a property with a default implementation in Initialize, then undoes the process in `Uninitialize`:

```csharp
[InitializableModule]
public class SampleInitialization: IInitializableModule {
  public void Initialize(InitializationEngine context) {}
  public void Uninitialize(InitializationEngine context) {}
}
```

- The initialization engine ensures that your code executes in a single-threaded manner.
  You do not need to lock regions when you deal with a shared state. This guarantee is only made for `Initialize` and `Uninitialize` when you execute through the initialization system. You may have to deal with multi-threading issues if you have custom code that makes calls directly into your initialization module.
- The initialization system tracks the initialization state of your module.
- Implement Uninitialize  – Anything you do with `Initialize` must be undone with `Uninitialize` in the reverse order of Initialize. This is important if you write integration tests that reset applications between test runs.
- If you are using the CMS API, add a module dependency to CMS using `[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]`.
