Get the colors of the pixels in a texture

Hello, I’m trying to get the list of colors of the pixels in a texture … this is my code:

Texture2D tile_texture = ListSprites.GetSprite(texture_id);
Color[] colors = new Color[tile_texture.Width * tile_texture.Height];
tile_texture.GetData(colors);

And this is the error that I receive in the last line:

SharpDXException:
HRESULT: [0x887A0005], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_DEVICE_REMOVED/DeviceRemoved], Message: Unknown

I have searched in other threads and other pages, but I have not found anything to help me. Does anyone know why it happens?

Maybe if there is some other way to get texture colors …

Normally what I do (because I needed it before) was to use external images of the Content in .bmp format and to use C# methods to extract the colors, but if it is possible otherwise …

Thanks in advance