I receive rare and intermittent error messages in our live environment. I was not successful in my attempts to reproduce it, and the mistake itself is a little mystery. Add to that, something seems to be related to the Enterprise Library trace (we are using version 5.0) - overall, a bit of a pain. This happens in Windows Sever 2008, the application is on .Net Framework 4.0 (WPF).
The following error message and stack trace:
ArgumentNullException: Value cannot be null. Parameter name: category <StackTrace> Server stack trace: at Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry.BuildCategoriesCollection(String category) at Microsoft.Practices.EnterpriseLibrary.Logging.Tracer.WriteTraceMessage(String message, String entryTitle, TraceEventType eventType) at Microsoft.Practices.EnterpriseLibrary.Logging.Tracer.WriteTraceEndMessage(String entryTitle) at Microsoft.Practices.EnterpriseLibrary.Logging.Tracer.Dispose() at TestApplication.ViewModelTest.<UpdateUsers>d__1a.MoveNext() Exception rethrown at [0]: at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.<SetException>b__1(Object state) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() </StackTrace>
Can anyone shed light on what might be causing this?
EDIT: I am not modifying LogEntry.BuildCategoriesCollection. The input to the BuildCategoriesCollection (String category) method is null.
The UpdateUsers method is as follows:
async void UpdateUsers() { Processing = true; using (traceMgr.StartTrace("Trace")) using (var engine = new EngineClient()) { Users = new List<UserMasterDataModel> { _blankUser }; var users = await engine.GetPossibleTagsTask(SelectedOutcomeId, _queue.SystemCd, _queue.QueueCd); Users.AddRange(users); } if (SelectedUser != _blankUser) {
Jmv
source share