C#的WinForms例外:第一次机会异常的类型'System.AccessViolationException“的异常、类型、机会、WinForms

2023-09-06 22:08:20 作者:等一个人

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

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

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

A第一次机会异常的类型'System.AccessViolationException发生在UavController.exe

调用看起来是这样的:

outputBroker.SelectedObjectPaths.AddWithID(((AgAircraft)飞机)。路径,((AgAircraft)飞机).InstanceName);

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

I can't find any indication of the problem.

推荐答案

这个问题是由您的API生成。无论你是在传递错误的数据的API,可以通过您的电话或API有其自身的问题。下面是可能会帮助你,如果你有机会到你的API的code微软链接:

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.