Microsoft   |   patterns & practices   |   Developer Network   |   Enterprise Library   |   Acceptance Testing Guide   |   Personal Site

Unity 2.1 - August 2012 update - Grigori Melnik: Thoughts on Agile Software Engineering and Beyond - Site Home - MSDN Blogs

Unity 2.1 - August 2012 update

Unity 2.1 - August 2012 update

  • Comments 2

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:
http://unity.codeplex.com/discussions/328841

2. Improving debugging experience on System.Threading.SynchronizationLockException:
https://entlib.uservoice.com/forums/89245-general/suggestions/2377307-fix-the-system-threading-synchronizationlockexcep

3. Improving debugging experience through better error messaging when a type cannot be loaded:
http://unity.codeplex.com/workitem/9223

4. Supporting a scenario of performing a BuildUp() on an existing instance of a class that doesn’t have a public constructor:
http://unity.codeplex.com/workitem/9460

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
  • 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.

    Thanks

  • 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.

Page 1 of 1 (2 items)
Leave a Comment
  • Please add 4 and 8 and type the answer here:
  • Post