Unity 2.1 – August 2012 update

Today we’ve shipped via NuGet an optional update to Unity (2.1.505.2) which includes the following fixes:

1. Addressing a thread safety issue:

2. Improving debugging experience on System.Threading.SynchronizationLockException:

3. Improving debugging experience through better error messaging when a type cannot be loaded:

4. Supporting a scenario of performing a BuildUp() on an existing instance of a class that doesn’t have a public constructor:

To make the update experience as simple as possible for users and to avoid the need for assembly binding redirects, we chose to only increment the assembly file version, not the .NET assembly version.

Comments (2)

  1. Eric says:

    Hi Grigori,

    I'm having a problem after using the interceptor extension.

    I have this test which is now failing after using the interceptor.

    actual = IocHelper.GetContainer().Resolve(typeof(IMyService), null, new ResolverOverride[0]);

               expected = typeof(MyService);

               Assert.IsInstanceOfType(expected, actual);

    the problem is that "actua" is now something like "DynamicModule.ns.Wrapped_IMyService_f9437035411847d4ba09c541213fce38" and hence the test now fails. Is my test invalid? I can see through the debugger that "target" field has the value I want to test for but this field is private.


  2. Eric,

    Yes, your test is invalid because when you use interface or virtual method interception that is not the expected type anymore. By design Unity generate a new type dynamically. See msdn.microsoft.com/…/ff660861(v=pandp.20) for comparison of interception techniques.

Skip to main content