NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Crash w/ Apple Bonjour / .net / TS2010

Hi,


I made a small .Net application which uses Apples Bonjour service. It basically filters for a certain name and returns to count. I derived the code from Apples demo application in the SDK which can be downloaded from macosforge.com

 

The program works standalon. But when I try to use it with TestStand .Net steps I get this error:

 

An exception occurred inside of the call to .NET member 'TsFindDevices':
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Bonjour.DNSSDServiceClass.Browse(DNSSDFlags flags, UInt32 interfaceIndex, String regtype, String domain, DNSSDEventManager eventManager)

 

Any ideas / alternative libs, how I can manages to use Bonjour with TestStand (.Net prefered)

 

0 Kudos
Message 1 of 4
(3,391 Views)

You most likely are not using the APIs correctly. Perhaps you passing an invalid index?

 

The fact that you are getting an access violation means the code is accessing memory which it shouldn't be. This is something that is generally rare from pure .NET code, which means you likely are using dllimport (i.e. pinvoke) or other low-level code which is pehaps either not written correctly, or not being used correctly.

 

There is most likely nothing special about calling the code from TestStand that should be leading to any difference in behavior in this case.

 

Hope this helps,

-Doug

0 Kudos
Message 2 of 4
(3,388 Views)

Thanks for your thoughts Doug.

 

To utilze Bonjour you have to install the service first. Then you have to add the reference to the Interop.Bonjour. I guess this means the Bonjour.dll is written in C++, which runs unmanaged code.

 

Is that correct?

 

0 Kudos
Message 3 of 4
(3,382 Views)

Yes, the fact that there is an interop would indicate it's unmanaged code, so I would make sure you are passing the correct parameters to it. Depending on how the code is written, incorrect parameters could lead to access violations.

 

-Doug

0 Kudos
Message 4 of 4
(3,368 Views)