Casting to generic types always produces this warning. You can do nothing against it (except suppressing the warning). The only thing you can do is accepting the warning. And perhaps take the warning as a - ehem - warning... to check your code if the method returnning the object you cast really returns a map of the type you need.
We are always encountered with this problem e.g. in deserialization, where you get only an object back.
By the way,
welcome to the Ranch, Xavier
all events occur in real time
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com