> For the complete documentation index, see [llms.txt](https://docs.conanjs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.conanjs.io/api/dependency-injection/dicontextfactory.md).

# DiContextFactory

Conan Factory to create the context to use for Dependency injection.

### ***createContext \<T, AUX  = void>***

creates the DI context

| Input      |                                                                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| contextDef | <p><strong>Type:</strong>  <code>DiContextDef\<T> </code><em><code>required</code></em></p><p>context definition</p>                  |
| aux        | <p><strong>Type:</strong>  <code>DiContextDef\<AUX> </code><em><code>optional</code></em></p><p>auxiliary dependencies definition</p> |

| Returns |   |
| ------- | - |
| T & AUX |   |
