This project is read-only.

publicKey cannot be null or empty

Mar 4, 2014 at 11:11 PM
I tried to use the web.config method of storing the publicKey and privateKey but I am getting an error - 'publicKey cannot be null or empty'. When I add it to the Recaptcha methodin the razor view it works fine. I tried both 'name' (which is wrong) and 'key', but get the same results.

I am using MVC 5 with EntityFramework 6 on Visual Studio 2013.

BTW: I tried both the main site web.config and a sub web.config in the view folder.

Any one else have this issue? Any one figure out how to get this going?

Thanks!
Mike
Aug 30, 2014 at 7:31 PM
Did you just recently update your recaptcha library? I did and they moved my cheese!
Here is what I had before:
<add key="recaptchaPublicKey" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
<add key="recaptchaPrivateKey" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
And here how it changed after
<add key="recaptchaPublicKey" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
<add key="recaptchaPrivateKey" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
<add key="recaptchaPublicKey" value="" /><add key="recaptchaPrivateKey" value="" />
They added an empty set in the web.config. Last one wins and it's empty!