---
title: Create an initialization module
slug: cms-12/docs/creating-an-initialization-module
docTags: 
createdAt: 2026-08-10T15:55:54.000Z
---

When you create your initialization module, add a reference to `EPiServer.Framework.dll`. The following Initialization code example shows how a property is set up with a default implementation in Initialize, and then the process is undone 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.
- **Remember that the initialization system tracks the initialization state of your module**.
- **Do an implementation of Uninitialize**.
  Anything you do with `Initialize` you should undo with `Uninitialize` in the reverse order of Initialize. This is especially important if you write integration tests that reset applications between test runs.
- If you are using the Optimizely Content Management System (CMS) API, make sure you are adding a module dependency to CMS using `[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]`.
