小编Sig*_*igh的帖子

确定AccessViolationException DragDrop.DoDragDrop的原因

我有一个WPF应用程序在启动拖动操作时在某些具有AccessViolationException的计算机上崩溃.

困难在于它只发生在构建服务器的构建上,并且在我在Visual Studio 2010中本地构建时永远不会崩溃.所以我无法单步执行代码.

我有以下信息:

  • 我们正在使用.net 4.0
  • 只有当应用程序作为64位进程运行时才会崩溃,32位就可以了.
  • 仅从构建服务器崩溃构建.
  • 不会在每台计算机上崩溃,只是在我们这里的一小部分笔记本电脑上.顺便提一下,所有相同的型号和硬件配置.所有都有Windows 7,有些有sp1,有些没有.

我应该采取的下一步措施来诊断这个问题?

这是崩溃的堆栈跟踪,它似乎发生在非托管代码中:

at MS.Win32.UnsafeNativeMethods.DoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
at System.Windows.OleServicesContext.OleDoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
at System.Windows.DragDrop.OleDoDragDrop(DependencyObject dragSource, DataObject dataObject, DragDropEffects allowedEffects)
at Acquire.Common.UI.Behaviours.DragDropBehaviour.StartDrag(RoutedEventArgs e)
at Acquire.Common.UI.Behaviours.DragDropBehaviour.AttachedElementMouseMove(Object sender, MouseEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, …
Run Code Online (Sandbox Code Playgroud)

c# debugging access-violation

11
推荐指数
1
解决办法
1899
查看次数

自定义wcf数据提供程序并调试关系错误

我正在实现一个自定义数据提供程序,我已经知道它返回数据并且可以进行过滤,但是在使关系工作时遇到了一些麻烦.

查询元数据时,关系看起来是正确的,并且在查询表时会出现相关的属性链接,但在尝试访问ResourceReference属性时,我会收到以下异常:

    Object reference not set to an instance of an object.
        System.NullReferenceException
        stacktrace at System.Data.Services.Providers.DataServiceProviderWrapper.GetResourceAssociationSet(ResourceSetWrapper resourceSet, ResourceType resourceType, ResourceProperty resourceProperty)
   at System.Data.Services.Providers.DataServiceProviderWrapper.GetContainer(ResourceSetWrapper sourceContainer, ResourceType sourceResourceType, ResourceProperty navigationProperty)
   at System.Data.Services.Providers.DataServiceProviderWrapper.GetResourceProperties(ResourceSetWrapper resourceSet, ResourceType resourceType)
   at System.Data.Services.Serializers.SyndicationSerializer.WriteObjectProperties(IExpandedResult expanded, Object customObject, ResourceType resourceType, Uri absoluteUri, String relativeUri, SyndicationItem item, DictionaryContent content, EpmSourcePathSegment currentSourceRoot)
   at System.Data.Services.Serializers.SyndicationSerializer.WriteEntryElement(IExpandedResult expanded, Object element, ResourceType expectedType, Uri absoluteUri, String relativeUri, SyndicationItem target)
   at System.Data.Services.Serializers.SyndicationSerializer.WriteTopLevelElement(IExpandedResult expanded, Object element)
   at System.Data.Services.Serializers.Serializer.WriteRequest(IEnumerator queryResults, Boolean hasMoved)
   at System.Data.Services.ResponseBodyWriter.Write(Stream stream)
Run Code Online (Sandbox Code Playgroud)

以下是我如何创建关系的示例:

var sourceReference = …
Run Code Online (Sandbox Code Playgroud)

wcf wcf-data-services

7
推荐指数
1
解决办法
748
查看次数

标签 统计

access-violation ×1

c# ×1

debugging ×1

wcf ×1

wcf-data-services ×1