# Exception using GetDeviceList method

**URL:** <https://community.stereolabs.com/t/exception-using-getdevicelist-method/4572>\
**Category:** C#\
**Created:** [February 15, 2024, 2:36pm UTC](https://community.stereolabs.com/t/exception-using-getdevicelist-method/4572 "2024-02-15T14:36:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![VR\_Neo](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/v/97f17d/32.png) [@VR\_Neo](https://community.stereolabs.com/u/VR_Neo)\
**Post date:** [February 15, 2024, 2:36pm UTC](https://community.stereolabs.com/t/exception-using-getdevicelist-method/4572/1 "2024-02-15T14:36:22Z")

</div>

Hello,

I am trying to get the device list in C# with 4.0.7 version of ZED SDK using this code:

```auto
 var deviceList = Camera.GetDeviceList(out int nbDevices);

```

Unfortunatly, I get this error, which seems to come from dll itself:

Exception non gérée : System.AccessViolationException: Tentative de lecture ou d’écriture de mémoire protégée. Cela indique souvent qu’une autre mémoire est endommagée.  
à System.StubHelpers.MngdNativeArrayMarshaler.ConvertContentsToManaged(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome)  
à sl.Camera.dllz\_get\_device\_list(DeviceProperties deviceList, Int32& nbDevices)  
à sl.Camera.GetDeviceList(Int32& nbDevices)

Furthermore, on the documentation page, **GetDeviceList** and **GetStreamingDeviceList** descriptions are exchanged.

Best regards!

---

<div class="post-metadata">

**Author:** ![JPlou](https://community.stereolabs.com/user_avatar/community.stereolabs.com/jplou/32/1012_2.png) [@JPlou](https://community.stereolabs.com/u/JPlou)\
**Post date:** [February 16, 2024, 10:02am UTC](https://community.stereolabs.com/t/exception-using-getdevicelist-method/4572/2 "2024-02-16T10:02:18Z")

</div>

Hello @VR_Neo,

Thanks for the report, we’ve identified the issue and it will be fixed for 4.1.

Sorry for the inconvenience.
