简体   繁体   English

C#NullReferenceException,但我不知道是什么原因引起的

[英]C# NullReferenceException, but I don't know what's causing it

I get a NullRefrenceException once in a while (it happens maybe one out of ten times) when I drop an object on a RadChart (from the Telerik-components). 当我将一个对象放到RadChart上时(从Telerik组件中),我偶尔会收到NullRefrenceException(可能发生十分之一)。

Now I'd like to know which object is causing the Exception, but I don't really understand which one it is from just looking at the StackTrace. 现在,我想知道是哪个对象引起了异常,但仅通过查看StackTrace,我并不能真正理解它是哪个对象。

That's the stack-trace: 那是堆栈跟踪:

bei System.Windows.Controls.VirtualizingStackPanel.BringIndexIntoView(Int32 index)
bei System.Windows.Controls.ItemsControl.OnBringItemIntoView(Object arg)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
bei System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
bei System.Threading.ExecutionContext.runTryCode(Object userData)
bei System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Windows.Threading.DispatcherOperation.Invoke()
bei System.Windows.Threading.Dispatcher.ProcessQueue()
bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
bei System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
bei System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
bei System.Windows.Application.RunInternal(Window window)
bei System.Windows.Application.Run()
bei Filiale_der_Zukunft.App.Main() in D:\oberflaeche-der-zukunft\TP_IT\Prototyp\Filiale der Zukunft\obj\Debug\App.g.cs:Zeile 0.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()

Nothing in your StackTrace shows the Telerik RadControl. StackTrace中没有显示Telerik RadControl。 Looking att the top of the stacktrace it seems that you try to show an element that is not yet created. 从堆栈跟踪的顶部看,您似乎试图显示一个尚未创建的元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NullReferenceException和我不知道为什么 - NullReferenceException and I Don't Know Why NullReferenceException未处理,我不知道为什么? - NullReferenceException was unhandled and I don't know why? 针对C#异步的秒表:我被秒表所迷惑了,还是有我不知道的东西? - Stopwatch against C# Async: Am I fooled by the stopwatch or there's something there I don't know? 我不知道这个c#模式/结构/代码被调用了什么 - I don't know what this c# pattern/structure/code is called 刚开始学习 C# & ASP.NET - 奇怪的语法(对我来说),我不知道它是什么 - Just started learning C# & ASP.NET - strange syntax (to me) and I don't know what it is 在vb.net或c#中寻找算法,但我不知道它的名字! - Looking for an algorithm in vb.net or c# but I don't know it's name! 我正在验证 C# 中的表格,但我不知道我做错了什么。 请帮我解决这个问题 - I'm validating a form in C# but I don't know what I am doing wrong. Please help me solve this 获取NullReferenceException不知道为什么 - Getting NullReferenceException don't know why 我需要做一个 python 项目,但我知道 C# 并且不知道如何转换它 - I need to make a python project but I know C# and don't know how to convert it 我不明白我的 Pong XNA/C# 代码有什么问题 - I don't understand what's wrong with my Pong XNA/C# Code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM