Foros del Web » Programación para mayores de 30 ;) » .NET »

Error en Servidor [ASPNET: Make sure that the class defined in this code...]

Estas en el tema de Error en Servidor [ASPNET: Make sure that the class defined in this code...] en el foro de .NET en Foros del Web. Muy buenas, después de mucho buscar en Google, posteo este error aquí a ver si alguien supiese como arreglarlo... La aplicación funciona correctamente en local, ...
  #1 (permalink)  
Antiguo 25/04/2014, 17:01
Avatar de Scour  
Fecha de Ingreso: octubre-2003
Ubicación: Murcia (España)
Mensajes: 94
Antigüedad: 20 años, 5 meses
Puntos: 0
Error en Servidor [ASPNET: Make sure that the class defined in this code...]

Muy buenas, después de mucho buscar en Google, posteo este error aquí a ver si alguien supiese como arreglarlo...

La aplicación funciona correctamente en local, el error solo se produce al subir al servidor.

aspx:

Código ASP:
Ver original
  1. <%@ Page Language="vb" AutoEventWireup="false" CodeFile="mycube.aspx.vb" Inherits="WebApplication1.mycube" %>
  2.  
  3. <!DOCTYPE html>
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.     <title></title>
  8. </head>
  9. <body>
  10.     <form id="form1" runat="server">
  11.     <div>
  12.    
  13.     </div>
  14.     </form>
  15. </body>
  16. </html>

vb:

Código ASP:
Ver original
  1. Public Class mycube
  2.     Inherits System.Web.UI.Page
  3.  
  4.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  5.  
  6.     End Sub
  7.  
  8. End Class

El error en el servidor es el siguiente:

Código ASP:
Ver original
  1. Compilation Error
  2.  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.
  3.  
  4.  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).
  5.  
  6. Source Error:
  7.  
  8.  
  9. Line 1:  Public Class mycube
  10. Line 2:      Inherits System.Web.UI.Page
  11. Line 3:

La versión de .Net es:

Código ASP:
Ver original
  1. Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

Desde ya muchas gracias por vuestro tiempo.
  #2 (permalink)  
Antiguo 26/04/2014, 09:46
 
Fecha de Ingreso: abril-2011
Mensajes: 1.342
Antigüedad: 13 años
Puntos: 344
Respuesta: Error en Servidor [ASPNET: Make sure that the class defined in this code..

Buenas,

Tienes que revisar si el namespace que estás usando en el .aspx es el mismo que en el .aspx.vb.

En el .aspx has definido: Inherits="WebApplication1.mycube", lo cual indica que el namespace en el .aspx.vb tendría que ser WebApplication1.

Es decir:

Código vb:
Ver original
  1. Namespace WebApplication1
  2.  
  3. Public Class mycube
  4.     Inherits System.Web.UI.Page
  5.  
  6.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  7.  
  8.     End Sub
  9.  
  10. End Class
  11.  
  12. End Namespace

Espero que esto te sirva.

Un saludo

Etiquetas: class, make, net, service, servidor, vb
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:42.