Tôi nhận được báo cáo về một lỗi hiếm gặp và không liên tục trong môi trường trực tiếp của chúng tôi. Tôi đã không thành công trong nỗ lực của tôi để tái sản xuất nó, và lỗi chính nó là một bí ẩn nhỏ. Thêm vào đó, nó có vẻ là một cái gì đó liên quan đến truy tìm thư viện doanh nghiệp (chúng tôi đang sử dụng phiên bản 5.0) - tất cả trong tất cả, một chút đau đớn. Điều này đang xảy ra trên Windows Sever 2008, ứng dụng nằm trên .Net Framework 4.0 (WPF).Lỗi doanh nghiệpLibrary
Các thông báo lỗi và stack trace sau:
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>
bất cứ ai có thể rụng bất kỳ ánh sáng vào những gì có thể gây ra điều này?
EDIT: Tôi không sửa đổi LogEntry.BuildCategoriesCollection. Đầu vào cho phương thức BuildCategoriesCollection (String category) là null.
Phương pháp UpdateUsers là như sau:
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)
{
// If null user selected then initialize to the case's tag, otherwise try to find the previously selected UserName
var userNameToFind = SelectedUser == null ? _details.TagTo : SelectedUser.UserName;
SelectedUser = Users.FirstOrDefault(user => user.UserName == userNameToFind) ?? _blankUser;
OnPropertyChanged("SelectedUser");
}
}
bạn đang sửa đổi 'LogEntry.BuildCategoriesCollection'? –
Bạn có thể thêm mã 'ViewModelTest' vào nơi bạn đang gọi' UpdateUsers' không? –
Chúng tôi cần thêm một số thông tin. Ví dụ chúng ta cần biết đầu vào cho phương thức gây ra ngoại lệ. Tất nhiên vấn đề là rõ ràng trong 'Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry.BuildCategoriesCollection (String category)' để bắt ngoại lệ. –