A first chance exception of type 'System.Threading.SynchronizationLockException' occurred in Microsoft.Practices.Unity

Mar 26, 2009 at 3:52 AM
I am using Unity with Silverlight and Prism 2. On my laptop (running Vista 32) I am seeing the following error in the output window in VS.NET 2008 SP1 - which I think is being caught internally by Unity.

A first chance exception of type 'System.Threading.SynchronizationLockException' occurred in Microsoft.Practices.Unity

On my desktop machine (running Vista 64) with the same codebase but I am not seeing the same error.

I first discovered that there was a problem on the laptop because the app (that uses Prism 2) I have some events being published and the subscribers are not being notified. The desktop machine is working great with Prism events.

Any idea what could be wrong?
Michael
Mar 26, 2009 at 9:35 PM
First chance exceptions are NOT bugs. They're exceptions that are thrown and handled. If you're using container.RegisterInstance, this is expected.


Mar 27, 2009 at 12:46 AM
Thank you for your response.

I am using container.Resolve - will that have the same result?
Mar 27, 2009 at 4:09 AM
It depends on how you're configuring the container, but typically no, you shouldn't be getting those on Resolve calls, only on RegisterInstance.

Aug 29, 2011 at 10:45 PM

This is just rubbish, how can an exception be expected?!?! You can't be serious.