Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

Rate It (2)

Last post 09-18-2009 6:04 AM by tmvsivakumar. 21 replies.

Sort Posts:

  • Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    02-26-2008, 1:34 PM
    • Member
      1 point Member
    • christolo
    • Member since 05-25-2007, 1:57 PM
    • Posts 4

     Anybody out there getting a similar error message? I also get the following errors:

     

    Error    36    'ASP.admin_managepolls_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override

    Error    37    'ASP.admin_managepolls_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' 

     

    Any help is greatly appreciated.

    Thanks.
     

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    02-26-2008, 2:44 PM
    • Star
      8,650 point Star
    • DavidKiff
    • Member since 12-07-2006, 11:07 PM
    • Hertfordshire, UK
    • Posts 1,733

    You really should provide some more information!  On guess work:

    You are implementing IHttpHandler however have not implemented IsReusable.  If your not can you copy and paste the class declaration for the admin_managepolls_aspx file?

    Regards

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    02-26-2008, 3:23 PM
    • Member
      1 point Member
    • christolo
    • Member since 05-25-2007, 1:57 PM
    • Posts 4

    The code is verbatim, from Admin/ManagePolls.aspx.cs in TheBeerHouse project. I believe on compilation it generates the ASP.admin_managepolls_aspx file.

    Thanks 

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    02-27-2008, 1:37 PM
    Answer
    • Contributor
      6,366 point Contributor
    • Lee Dumond
    • Member since 11-03-2004, 2:51 PM
    • Decatur, IL USA
    • Posts 1,168

     I strongly suspect you converted the your project as some point by opening it in VS2008. Is that correct?

    If so, delete the directory "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\app" . Again, these are only temp files and won't be missed. That should solve your issue.

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    02-27-2008, 2:06 PM
    • Member
      1 point Member
    • christolo
    • Member since 05-25-2007, 1:57 PM
    • Posts 4

     I didn't ever open it in VS2008; however, deleting those temp files did the trick. Don't know why. Thanks.

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    02-27-2008, 2:14 PM
    • Contributor
      6,366 point Contributor
    • Lee Dumond
    • Member since 11-03-2004, 2:51 PM
    • Decatur, IL USA
    • Posts 1,168

    christolo:

     I didn't ever open it in VS2008; however, deleting those temp files did the trick. Don't know why. Thanks.

     

    Good deal. I've seen this happen under both scenarios, but it's somewhat more common after conversion, because that can sometimes create new temp files that conflict with the existing ones. 

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    03-04-2008, 8:40 AM
    • Member
      8 point Member
    • bopritchard
    • Member since 04-13-2006, 12:18 PM
    • Posts 33

     i'm getting the same error message and deleted my temp directories to no avail...

     

    what else can i check? 

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    03-04-2008, 10:22 AM
    • Member
      1 point Member
    • christolo
    • Member since 05-25-2007, 1:57 PM
    • Posts 4

     Well, I don't know if it was by accident that deleting the temp files did the trick, because I also made some pages inherit from System.Web.UI.Page, rebuilt the project, and it worked.

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    04-20-2008, 2:07 AM
    • Member
      2 point Member
    • chuanbozhang
    • Member since 05-22-2007, 8:38 AM
    • Shanghai
    • Posts 1

    I also encountered the same problem, but finally I found the reason.

    I mistake to type the base page, shoud be some BasePage class, but I uses BaseUserControl class, and once I changed to BasePageClass,the pages compiles fines

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    06-04-2008, 11:23 AM
    • Member
      2 point Member
    • sg53719
    • Member since 06-04-2008, 3:21 PM
    • Posts 1

    I also had this problem. I resolved it by adding the namespace to the Inherits= on the page directive...

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    06-09-2008, 5:27 AM
    • Member
      2 point Member
    • jj_tins
    • Member since 10-31-2007, 12:15 PM
    • Posts 1

    Yup, that works. Thanks

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    06-14-2008, 3:05 PM
    • Member
      2 point Member
    • evildonald
    • Member since 10-15-2007, 12:09 PM
    • Posts 1

    Thanks. This fixed my problems as well!  Can't believe I fell for such a stupid error.  This was compounded by VS2008 not working out what the actual error is.

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    08-19-2008, 6:24 PM
    • Member
      2 point Member
    • MrDale
    • Member since 08-19-2008, 10:02 PM
    • Posts 1

    Ok, so here is what I have figured out.  So here is what I noticed. 

    1.  If you create a project in visual studio 2008 , and your going to be using this project to build a website and connect it with C# classes you can do so and not get the afore mentioned error.  It works fine. 

    2. However, if you build a "website" per the drop down list of options on the file menu on visual studio 2008 and try to add C# classes that are beyond the code behind files you will then notice that at compile time you get the error GetTypeHashCode()': no suitable method found to override.

    There are a mirade of ways around this.  But the one that was used by me and my managment on a previouse project was this.  We built a website as per the file drop down list.  We however wanted to use further C# classes to impliment a 3 tier design scheme (as seen in The Beer House).  So we added classes.  Now at the time I did not notice that this problem existed, however, I believe the fix was to just delete/remove the gettypehashcode method completely from the website.  Because when I search for it on that old project, it does not exist anywhere.

    Here is the other interesting thing.  Now if you just build your site as a project and add web forms too it, you will not get this error either.

    So we have 2 easy ways around this, 1 build your website as a project, and 2 build as a website and remove the said hashcode method completely from the site and continue to add your C# classes as you please.

    The reason this happens.  I am still not completely sure, however I do believe that the hashcode method is needed for the website to give more functionality down the road somewheres.  But if you add other C# files beyond the code behind files you break a rule of sorts and you get the error.  Becuase its attempting to overide a method that does not exist.  Where as if you build it as a project, this method does not exist in the first place.

    Just another interesting behavior you can add to your list!

     

    Have FUN!

     

    DJC

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    09-23-2008, 12:31 PM

    Uhg!!

    None of the above posts seem to help me in my situation.  I am new to ASP.Net.  I am working on a loginCheck.aspx page with a codeFile of loginCheck.aspx.cs

    loginCheck.aspx:

    <%@ Page Language="C#" debug="true" CodeFile="loginCheck.aspx.cs" Inherits="JMUAuthSample.CustomIdentity" %>

    <script language="C#" runat="server">
    protected void Page_Load(object sender, EventArgs e) {
      Response.Write("loginCheck.aspx - " + Server.HtmlEncode(User.Identity.Name) + "<br>");


      Response.Write("loginCheck.aspx - " + HttpContext.Current.User + "<br>");
      if (HttpContext.Current.User != null) {
        Response.Write("loginCheck.aspx - " + HttpContext.Current.User.Identity.IsAuthenticated + "<br>");
        if (HttpContext.Current.User.Identity.IsAuthenticated) {
       Response.Write("loginCheck.aspx - " + HttpContext.Current.User.Identity.Name + "<br>");
       Response.Write("Session - " + Session.Contents["domainName"] + "<br>");
       Response.Write("loginCheck.aspx - " + (HttpContext.Current.User.Identity is FormsIdentity) + "<br>");
          if ((HttpContext.Current.User.Identity is FormsIdentity)) {
         Response.Write("blah1<br>");
            //System.Security.Principal.GenericPrincipal principal = (System.Security.Principal.GenericPrincipal)HttpContext.Current.User;
            //FormsIdentity id = (FormsIdentity)principal.Identity;
      //Response.Write("loginCheck.aspx - id.Name - " + id.Name + "<br>");
            //CustomIdentity ident = new CustomIdentity(id);
            // HttpContext.Current.User = new System.Security.Principal.GenericPrincipal( ident, ** usersroles ** );
          }
        }
      }  

      //Response.Redirect("loadSession.asp?uid=" + Server.HtmlEncode(User.Identity.Name) + "&domain=" + Session.Contents["domainName"]);
    }
    </script>

    loginCheck.aspx.cs:

    using System;
    using System.Web.UI;
    using System.Collections.Specialized;
    using System.Security.Principal;
    using System.Xml;

    namespace JMUAuthSample {
        public partial class CustomIdentity : IIdentity {
            private bool _bIsAuthenticated;
            private string _sAuthenticationType;
            private string _sUserName;
            private string _sFirstName;
            private string _sLastName;
            private StringCollection _lstRoles = new StringCollection();

            public CustomIdentity(string sUserName, bool bIsAuthenticated, string sAuthenticationType)
            {
                _sUserName = sUserName;
                _bIsAuthenticated = bIsAuthenticated;
                _sAuthenticationType = sAuthenticationType;           
            }

            /// <summary>
            /// The type of authentication used.
            /// </summary>
            public string AuthenticationType    //Required by IIdentity
            {
                get    { return _sAuthenticationType; }
            }

            /// <summary>
            /// Indicates whether user has been authenticated.
            /// </summary>
            public bool IsAuthenticated    //Required by IIdentity
            {
                get    { return _bIsAuthenticated;    }
            }

            /// <summary>
            /// The unique name of the user.
            /// </summary>
            public string Name    //Required by IIdentity
            {
                get    { return _sUserName; }
            }

            /// <summary>
            /// The user’s last name.
            /// </summary>
            public string FirstName    //For the ‘firstName’ attribute.
            {
                get    { return _sFirstName; }
                set { _sFirstName = value; }
            }

            /// <summary>
            /// The user’s first name.
            /// </summary>
            public string LastName    //For the ‘lastName’ attribute.
            {
                get    { return _sLastName; }
                set { _sLastName = value; }
            }

            /// <summary>
            /// A list of roles the user is a member of.
            /// </summary>
            public StringCollection Roles    //For the ‘role’ elements.
            {
                get { return _lstRoles; }
            }
        }
    }

     

    I don't understand why the GetTypeHashCode() function is being loaded or in this case overloaded in the first place.  The JMUAuthSample Namespace is a renamed namespace for testing, but I pulled the code from some code site.  Ultimately I don't understand how to make a namespace work in a codefile. 

    Any help would be appreciated. 

     

     

  • Re: Error 35 'ASP.admin_managepolls_aspx.GetTypeHashCode()': no suitable method found to override

    09-23-2008, 12:47 PM
    • Contributor
      6,366 point Contributor
    • Lee Dumond
    • Member since 11-03-2004, 2:51 PM
    • Decatur, IL USA
    • Posts 1,168

     This is your issue:

    <%@ Page Language="C#" debug="true" CodeFile="loginCheck.aspx.cs" Inherits="JMUAuthSample.CustomIdentity" %>

    Pages must inherit from a class or partial class of type System.Web.UI.Page (or a class that derives from System.Web.UI.Page).

    Your page code-behind is a custom class that inherits from the IIdentity interface. That will never work.

    If you want to define this CustomIdentity class, do so in a separate file in your App_Code folder, not in the code-behind of a page.

     

Page 1 of 2 (22 items) 1 2 Next >