Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Make sure that the class defined in this code file matches the 'inherits' attribute

Reply
Thread Tools

Make sure that the class defined in this code file matches the 'inherits' attribute

 
 
christian.Blackburn@Yahoo.com
Guest
Posts: n/a
 
      06-14-2006
Hi Gang,

On my development system I am not getting this error, but it does
happen when I upload it to my ISP. Can someone tell me why this is
happening? I don't have any user-defined controls which seems to be
the primary cause. My code is ASP 2.0/VB.

Thanks a bunch,
Christian Blackburn
---------------------------------------------------------------------------------------------------------------------------------------
Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: ASPNET: Make sure that the class defined in
this code file matches the 'inherits' attribute, and that it extends
the correct base class (e.g. Page or UserControl).

Source Error:



Line 6:
Line 7:
Line 8: Partial Class LoginH
Line 9: Inherits System.Web.UI.Page
Line 10:


Source File: E:\web\motoadvisor\htdocs\Login.aspx.vb Line: 8 \
---------------------------------------------------------------------------------------------------------------------------------------

 
Reply With Quote
 
 
 
 
Christian Blackburn
Guest
Posts: n/a
 
      06-14-2006
Hi Gang,

I guess this is a pretty small group, because no-one answered my
question. However, I did figure it out and would very much like the
next guy to not suffer the same problems I did. I found so much
worthless unrelated Q+A on the web. It was an ASP.net 1.1 \bin\ folder
on the remote website that was causing the problems. Once I deleted
that folder the issue went away entirely.

Thanks,
Christian Blackburn

 
Reply With Quote
 
 
 
 
kphani_prasad kphani_prasad is offline
Junior Member
Join Date: Nov 2008
Posts: 4
 
      11-25-2008
Thanks Christian,
We have come across this problem, we observed that same class file name is used in different codebehind classes/pages.

when we removed those conflicts, problem resolved.

hope it helps,
--Phani, India
Quote:
Originally Posted by Christian Blackburn
Hi Gang,

I guess this is a pretty small group, because no-one answered my
question. However, I did figure it out and would very much like the
next guy to not suffer the same problems I did. I found so much
worthless unrelated Q+A on the web. It was an ASP.net 1.1 \bin\ folder
on the remote website that was causing the problems. Once I deleted
that folder the issue went away entirely.

Thanks,
Christian Blackburn
 
Reply With Quote
 
rconte rconte is offline
Junior Member
Join Date: Mar 2009
Posts: 1
 
      03-24-2009
I had a master file, .master + .master.vb like this: (file name next first line inside)

Master 1 -----------------
wFormularios.master
<%@ Master Language="VB" CodeFile="wFormularios.master.vb" Inherits="formularios" %>

wFormularios.master.vb
Partial Class formularios


Needed another, similar master, so I made a copy and cjanged the external name; ended with 2 master files, like this.

Master 1 -----------------
wFormularioPesquisa.master
<%@ Master Language="VB" CodeFile="wFormularioPesquisa.master.vb" Inherits="formularios" %>

wFormularioPesquisa.master.vb
Partial Class formularios

Master 2 -----------------
wFormularioPesquisa.master
<%@ Master Language="VB" CodeFile="wFormularioPesquisa.master.vb" Inherits="formularios" %>

wFormularioPesquisa.master.vb
Partial Class formularios



Note the same partial class name. That resulted in the error.
Changed the class name by adding a "2" in the second master file, that solved the problem. Like this:

Master 2 -----------------
wFormularioPesquisa.master
<%@ Master Language="VB" CodeFile="wFormularioPesquisa.master.vb" Inherits="formularios2" %>

wFormularioPesquisa.master.vb
Partial Class formularios2

------
 
Reply With Quote
 
Silvio443 Silvio443 is offline
Junior Member
Join Date: May 2012
Posts: 1
 
      05-14-2012
In my case, running a site on .Net 2.0.57***, I have a problem like this error message. The site has run well and uses two IIS web servers with load balancer. But since I updated on of the two .vb scripts in the folder, the same code started to give this error. I tried all the possible solutions (originally it has the right CodeFile and Inherits attribute values in Page declaration and they are unique). No change from CodeFile to CodeBehind helped. The same error appeared also in the other script in same folder. For example, I have /Developments/Details.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/Master.master" AutoEventWireup="true" CodeFile="Details.aspx.vb" Inherits="Developments_Details" %>


And the Details.aspx.vb code is:
Imports Smart
Imports System.Data
Imports System.Data.SqlClient

Partial Public Class Developments_Details
Inherits SmartPage

Where SmartPage is the a class in folder App_Code. Other pages that inherit it (and it inherits as base class System.Web.UI.Page) work fine. But after

change of the script, even returning the original one, I constantly get the same error "500: ....\developments\Details.aspx.vb(1): error ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (". What you would advise me to do?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
ERROR - Make sure that the class defined in this code file matches the 'inherits'.... gec ASP .Net 1 06-26-2008 01:06 PM
Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). murl ASP .Net Web Controls 0 03-27-2007 10:29 PM
Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). murl ASP .Net 0 03-27-2007 09:30 PM
#if (defined(__STDC__) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) Oodini C Programming 1 09-27-2005 07:58 PM



Advertisments