Microsoft | patterns & practices | Developer Network | Enterprise Library | Acceptance Testing Guide | Personal Site
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.
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);
expected = typeof(MyService);
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.
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.