IsolatedStorageTraceListenerData: The repository is not available

Topics: Logging Application Block, Silverlight Integration Pack
Aug 12, 2013 at 4:22 PM
Hi I am facing a similar problem like this guy here has anybody solve this problem or any ideas of what is causing it?
Summary for Enterprise Library Distributor Service:
======================================
--> 
Message: 
Timestamp: 09/08/2013 13:33:12
Message: Configurando contenedor Unity.
Category: Logging
Severity: Information
--> TimeStamp: 09/08/2013 13:33:12
--> FullName: Microsoft.Practices.EnterpriseLibrary.Logging.Silverlight, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
--> AppDomainName: Silverlight AppDomain

Exception Information Details:
======================================
Exception Type: System.InvalidOperationException
Message: The repository is not available. The most likely cause is that the repository file is already being used by another instance.
Data: System.Collections.ListDictionaryInternal

StackTrace Information Details: 
======================================
   at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.IsolatedStorageLogEntryRepository.CheckAvailable()
   at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.IsolatedStorageLogEntryRepository.Add(LogEntry entry)
   at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.IsolatedStorageTraceListener.TraceData(TraceEventCache traceEventCache, String name, TraceEventType eventType, Int32 id, Object data)
   at Microsoft.Practices.EnterpriseLibrary.Logging.LogSource.TraceData(TraceEventType eventType, Int32 id, LogEntry logEntry, TraceListenerFilter traceListenerFilter, TraceEventCache traceEventCache)
   at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterImpl.ProcessLog(LogEntry log, TraceEventCache traceEventCache)
Aug 12, 2013 at 5:07 PM
Can you reproduce the issue with a sample solution? I think that would be a good starting point.

As mentioned in the other thread, any configuration changes are inherently not thread-safe so they could result in the observed behavior if multiple threads are involved. Similarly, another way the behavior could be observed is if the listener is disposed on one thread while other threads are attempting to Add LogEntry's (actually, Add, RetrieveEntries, Flush all check if the repository is set).

Another scenario that might cause the issue is another instance of the application running (perhaps running in the background in an orphaned browser instance?) which causes a failure to open the Isolated Storage.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to