Ran into this exception while trying to add a client certificate to a SOAP client.
After installing the certificate through the mmc->Certificate snap-in I tried to copy the Thumbprint of the said certificate so that my client application would be able to use it.
The snap-in dispays the thumbprint as follows:
34 f7 83 fc 40 f6 1d d7 1c 92 43 c9 a5 af aa 42 ba 5e 27 dbSo I just copied it and inserted it into my app.config.
First exception was from the fact that the thumbprint needs to be a string without spaces, converted the string to:
34f783fc40f61dd71c9243c9a5afaa42ba5e27dbThis time I got the exception FormatException: Invalid Hexadecimal string format. I copied the string from the snap-in again and this time I pasted it into Notepad++ to see if there were anything else hidden in the string. As it turned out there was.
?34 f7 83 fc 40 f6 1d d7 1c 92 43 c9 a5 af aa 42 ba 5e 27 dbSo pasting back into the app.config and this time removing the starting character and the starting quote and manually writing them back and the just to be safe doing the same thing with the ending character and the ending quote it worked. Don’t forget to remove the spaces as well.
Hope this helps somebody out there as it really slowed me down last night. : )
Until next time: Work to Live, Don’t Live to Work