Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 2 commits behind compose-net:dev.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Join the chat at

Latest Release NuGet

Build status Stories in Backlog Stories in Ready Stories in Progress


Compose is a lightweight framework to assist in application composition, enforcing clean and efficient component isolation, whilst providing key features out of the box.

Compose follows the same OWIN composition patterns as found in the MVC 6 samples, but on a broader basis, minimising dependencies and providing consistent patterns across all application types, from ASP.Net MVC, to Console Applications.

Getting Started


  • .Net 4.5.2 or higher

Install Compose

Includes built-in support for Dependency Injection, Transitioning, Snapshotting, and basic Executable Applications.

To install Compose, run the following command in the Package Manager Console

PM> Install-Package Compose -Pre

Basic Usage


Dependency Injection

There are a myriad of DI Containers available nowadays such as Autofac, Castle Windsor, Ninject, StructureMap, Unity, etc.

As part of ASP.Net vNext development, Microsoft are releasing an Open Source Dependency Injection Framework that supports all of the popular existing containers listed above.

We utilise this new framework so that, unless you need additional features provided by Compose, your services only require a dependency on the Microsoft.Framework.DependencyInjection package.


One of the key features Compose provides is the ability to seamlessly switch your service implementations at runtime. No additional code or changes are required in your service extensions, simply tag the service(s) as Transitional during composition.

For example:

app.UseServices(services => 
		// Mark one of the interfaces added by your service as transitional
// So long as an interface is regsitered as transitional, you can change it at any stage using
app.Transition<IDependency, MyReplacementDependency>();


This feature allows your application to better manage dependencies, particularly those for which your application is not responsible. For example, you may transition an interface from a service extension without any knowledge of how the interface is implemented. Snapshotting allows you to Rollback the dependency graph to use the original implementation, without the need to reference it directly.

app.UseServices(services =>
		// Mark all interfaces as transitional
// app.Snapshot() is called for you by UseServices, but you can
// call it at any stage to overwrite the existing snapshot.

// Transition a component to your own implementation
app.Transition<IDependency, MyReplacementDependency>();
// When you want to transition back to the original service

FAQ / Troubleshooting

-Q. How to debug/view the code emitted? -A. Add the ENABLE_SAVE_DYNAMIC_ASSEMBLY compilation symbol to the Compose build to have the dyanmic assemblies stored in the execution directory.


Lightweight framework to assist in application composition







No packages published


  • C# 99.1%
  • Batchfile 0.9%