ASP.NET分析器错误消息:无法加载类型“搜索”.从另一个项目复制文件后

我在visual studio一个工作网站的网站项目.
我可以毫无问题地查看所有页面.

现在我从另一个Web应用程序项目复制了2个文件
search.aspx
search.aspx.vb

search.aspx源代码

<%@ 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源代码

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

但是当我尝试请求页面时:www.test.com/search.aspx我收到此错误
说明:解析为此请求提供服务所需的资源时发生错误.请查看以下特定的解析错误详细信息并相应地修改文件.

分析器错误消息:无法加载类型“搜索”.

来源错误

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

当我尝试构建项目时,我已经看到错误:无法加载类型“搜索”.
我不知道在哪里寻找这个.

解决方法

事实证明我必须在search.aspx中将“CodeBehind”更改为“CodeFile”…现在它再次起作用.

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....