What happens to "Microsoft.Practices.EnterpriseLibrary.Caching" when trying to access "CacheFactory.GetCacheManager ();"?

What am I doing wrong here or what am I not doing? (I use this code in .NET 4.0 WCF Service)

        private static ICacheManager GetCacheManager()
    {
        try
        {                
            return CacheFactory.GetCacheManager();   
        }
        catch (SynchronizationLockException ex)
        {
            EventLogHelper.WriteError(ex);
        }
        catch (ConfigurationException ex)
        {
            EventLogHelper.WriteError(ex);
        }
        return null;
    }

When the debugger returns, this exception is returned:

Error System.Threading.SynchronizationLockException Message = The object synchronization method is called from an unsynchronized code block. Source = Microsoft.Practices.Unity Stack Traces: at Microsoft.Practices.Unity.SynchronizedLifetimeManager.TryExit () at e: \ Builds \ Unity \ UnityTemp \ Compile \ Unity \ Unity \ Src \ Lifetime \ SynchronizedLifetimeManager.cs: line 109 InnerException:

Is this a bug in the Enterprice library?

+5
4
+8

, Enterprise Library Unity, . , , Break, CLR.

.

+7

WCF. (Entlib 5.0,.net 4.0)

Database db = DatabaseFactory.CreateDatabase();

, SqlDatabase. , , , , , .

0

, EntLib. . VS 2015, | | | " " .

0

All Articles