Home Forums Support KeyNotFoundException Reply To: KeyNotFoundException


The exception seems to be being thrown by the decryption step so I don’t think this is protobuf related at least. The only place I can think that a KeyNotFoundException could be thrown, is if the symmetric pre-shared password was not in the options Dictionary at the point the exception is thrown. This is a bit odd though as it should throw an ArgumentException in that case as we catch it specifically.

Are you using the latest version of NetworkComms available from the downloads page or something older? This would potentially explain the different exception.

How are you adding the pre-shared secret? I assume you are adding it to the global send receive options (on the receiving end as well as the sending end) as you don’t specify it when adding the handler?

One final request to confirm that this is not due to serialization in some strange way; if you replace your clsServerLicInfo object in the send/receive as you have it above with something simple like a string is the exception still thrown?

Hopefully we can get to the bottom of this quickly and find a solution for you. If it is confirmed as a bug it should be easy enough to fix based on where the exception is.