Implement Google reCaptcha v2 on ASP.NET Visual Basics Codebehind Webforms

snajalm
snajalm used Ask the Experts™
on
I need to implement Google reCaptcha on an old ASP.NET VB Webforms platform and I need a complete code that would help me do that.

I haven't done VB before and have done some webforms development long time ago.

I have followed the instructions of the following link but can't seem to get it right.  I have added the Assembly Recaptcha.dll on the frontend code with the associated VB code inside a <script runat=server> tag just like the guide and after recompiling and replacing the compiled code on the site, it doesn't seem to be able to load the Assembly and pops out the following error message,

Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Could not load file or assembly 'Recaptcha, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

Source Error: 

Line 1:  <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="register.aspx.vb" Inherits="Website.Members.clsRegister_Page" %>
Line 2:  
Line 3:  <%@ Register TagPrefix="uc1" TagName="ucMessageBox" Src="../controls/ucMessageBox.ascx" %>

Open in new window


All in all if you could help with with the exact implementation code, I would really appreciated it.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Commented:
https://developers.google.com/recaptcha/docs/v3 provides V3 info.

V3 works far better than V2.

If you think you simply must install V2, the various old V2 setup instructions can be found down the left of the above page.

Author

Commented:
Thanks David,

I have implemented the reCaptcha but could you please explain how to get around this issue,

Could not load file or assembly 'Recaptcha, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

Open in new window


Do you know what this is?  I even tried creating a Recaptcha.snk file through the sn.exe file and sign it to the Recaptcha.dll library in the Reference list but doesn't seem to work and I am really getting frustrated.

Mind you that this code is very old and written in .NET Framework 3.5.

Regards

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial