Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Parser Error Message: Could not load type 'search'. after copying files from another project

Tags:

asp.net

I have a working website website project in visual studio. I can view all pages without a problem.

Now I copied 2 files from another Web Application Project I have: search.aspx search.aspx.vb

search.aspx source snippet

<%@ Page EnableViewState="true" EnableEventValidation="false" MetaDescription="<%$Resources:metadescription%>" Title="<%$Resources:pagetitle %>" Language="VB" MasterPageFile="~/main.master" AutoEventWireup="false" Inherits="search" Codebehind="search.aspx.vb" %>
<%@ MasterType VirtualPath="~/main.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

search.aspx.vb source snippet

Imports System
Imports System.Net
Imports System.IO
Imports GlobalFunctions
Imports System.Xml
Imports System.Collections.Generic
Imports System.Collections
Imports System.Linq
Imports System.Resources
Imports generalMethods
Imports System.Globalization

Partial Class search
    Inherits System.Web.UI.Page

But when I try to request the page: www.test.com/search.aspx I get this 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 type 'search'.

Source Error:

Line 1:  <%@ Page EnableViewState="true" EnableEventValidation="false" MetaDescription="<%$Resources:metadescription%>" Title="<%$Resources:pagetitle %>" Language="VB" MasterPageFile="~/main.master" AutoEventWireup="false" Inherits="search" Codebehind="search.aspx.vb" %>
Line 2:  
Line 3:  <%@ MasterType VirtualPath="~/main.master" %>

Source File: /search.aspx    Line: 1 

When I tried building the project, I already see the error: Could not load type 'search'.
I have no idea anymore where to look for this.

like image 597
Adam Avatar asked Aug 08 '12 20:08

Adam


2 Answers

Turns out I had to change "CodeBehind" to "CodeFile" in search.aspx...now it all works again.

like image 103
Adam Avatar answered Oct 23 '22 11:10

Adam


This can also occur if the WAP's DLL in the bin directory on the webserver is outdated and therefore does not contain a precompiled code behind for the requested page.

like image 23
MrMeek Avatar answered Oct 23 '22 09:10

MrMeek