Microsoft Unity Container 3.5 – Final Release
Welcome to the final release of the Microsoft Unity Application Block 3.5 (Unity)!
This document contains a brief summary of the improvements made to Unity. Additional information and bug fixes delivered after release are available on the
Unity Community site
and on the
Unity MSDN site
Where to Get It?
Via NuGet – use the NuGet Package Manager in Visual Studio and search online for the “unity” packages. Pick the official Microsoft packages.
What’s New in this Release?
This release of Unity contains several updates and bug fixes that will make developers more productive and ease cross-platform application development. Specifically:
- Transforming the individual platform targeted Unity into a PCL, including support for:
- Windows Store Apps 8.0 and 8.1
- Windows Phone Silverlight 8.0 and 8.1
- .NET 4.5 and up
- Xamarin/Mono (Xamarin.iOS v7 and
- See known issues below regarding Windows Phone 8.1.
- Performance improvements (we have streamlined the internals of Unity without impacting the public-facing API. In running micro-benchmarks, we have consistently seen a performance improvement of Unity core operations by ~60%).
- Bug fixes (8777,
- Updating the dependency on the latest Common Service Locator PCL (1.2)
- Debug symbols and source code are available from
The following learning resources are recommended:
- Development team: Carlos Farre , Christopher Bennage, Fernando Simonazzi, Grigori Melnik, Mani Subramanian, Nelly Delgado, Randy Levy, RoAnn Corbisier
- Subject matter experts: Chris Tavares, Daniel Piessens
- Community contributors
Providing Feedback and Contributing
We would appreciate feedback on any issues found, or any other general comments on this release.
To report a bug, use the online
. Other feedback or questions can be posted on the Codeplex
. In addition, we are encouraging and accepting community contributions. For more information, please see
We look forward to your pull requests!
Community support is provided via CodePlex
. Customers can obtain support through Microsoft Premier Support Services for a fee, but the code is considered user-written by Microsoft support engineers.
- It is important to ensure all resolve requests involving the PerRequestLifetimeManager occur in the appropriate ASP.NET request-handling thread so the request's HttpContext can be accessed. When implementing asynchronous request handlers, such as
ASP.NET MVC's asynchronous action methods, it is possible to initiate a Resolve operation in a thread other that the ASP.NET thread. Using the TPL, an await after invoking ConfigureAwait(false) on an asynchronous operation will result in a missing context
and thus an error on a Resolve operation initiated after the await. Resolve operations can be explicit calls to the Resolve method of a container, but they can also be the less obvious outcome of invoking a Func<T> or getting the value from a Lazy<T>
injected by the container using the
Automatic Factory or
Deferred Resolution features.
- With regards to performance, customers are encouraged to run their own micro-benchmark and performance tests to measure improvements which can vary on different system environments.
- Debug symbols and source code for the Unity NuGet packages is provided through SymbolSource. For information about setting up SymbolSource as a symbol an source server for Visual Studio see http://www.symbolsource.org/Public/Home/VisualStudio.
- Currently, the Unity PCL does not support the Windows Phone 8.1 target. However, a
pre-release NuGet package supporting Windows Phone 8.1 is available.
- The registration by convention feature was extracted to separate platform-specific assemblies in the core Unity package. This feature is only available for .NET 4.5, Windows Store 8, and Windows Phone 8 apps.
- Xamarin support - Testing was done by running unit tests on the iOS 7.1 emulator and smoke testing using an app on an Android device. In addition perf testing has not been done for Xamarin support. Note there is no official NuGet support in Xamarin Studio
as of the date of this release. There's a third-party
- On Windows Phone Silverlight 8.1 the registration by convention helper method AllClasses.FromApplication fails with a NotSupportedException thrown by the runtime. In this case you need to supply the list of assemblies to scan manually.
- Projects using the Unity PCL will fail to build when targeting 4.5.2.