C# WinForms 异常:“System.AccessViolationException"类型的第一次机会异常 [英] C# WinForms exception: A first chance exception of type 'System.AccessViolationException'

查看:34
本文介绍了C# WinForms 异常:“System.AccessViolationException"类型的第一次机会异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基本的 WinForms 应用程序.我正在调用产生以下异常的外部 API:

I have a basic WinForms application. I'm making a call to an external API which is generating the following exception:

试图读取或写入受保护的内存.这通常表明其他内存已损坏.

UavController.exe 中第一次出现System.AccessViolationException"类型的异常

调用如下所示:

outputBroker.SelectedObjectPaths.AddWithID(((AgAircraft)aircraft).Path, ((AgAircraft)aircraft).InstanceName);

我找不到任何问题的迹象.

I can't find any indication of the problem.

推荐答案

该问题是由您的 API 生成的.要么您通过调用将错误数据传递给 API,要么您的 API 本身存在问题.如果您有权访问 API 的代码,这里是一个 Microsoft 链接,可能会对您有所帮助:

The issue is one generated by your API. Either you are passing in bad data to the API through your call or your API has an issue on its own. Here is a Microsoft link that might help you if you have access to the code of your API:

http://msdn.microsoft.com/en-us/library/ms164911(v=vs.80).aspx

否则,我认为您可能需要与您的 API 提供商合作,找出问题所在以及如何解决.

Otherwise, I think you might need to work with your API provider to figure out what the issue is and how to resolve it.

这篇关于C# WinForms 异常:“System.AccessViolationException"类型的第一次机会异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆