【问题标题】:ASP.Net error while migrating website to a new server将网站迁移到新服务器时出现 ASP.Net 错误
【发布时间】:2013-02-05 23:20:49
【问题描述】:

我正在将我的网站迁移到一个新服务器,它是在 .NET 中的,我对这种语言没有太多经验。但是我尝试搜索修复但没有成功。有人可以帮忙吗?

错误:

编译器错误消息:ASPNET:确保在 此代码文件匹配 'inherits' 属性,并且它扩展 正确的基类(例如 Page 或 UserControl)。

来源错误:

Line 1:  <%@ Page Title="" Language="VB" MasterPageFile="~/EnjoyMaster2.master" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
Line 2:  
Line 3:  <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

【问题讨论】:

  • 您还需要发布代码隐藏文件...
  • 你是否也移动了 bin 文件夹?
  • 是此服务器上的 bin 文件夹
  • 从什么服务器到什么服务器?

标签: asp.net .net server-migration


【解决方案1】:

确保 Inherits 属性和此代码文件中定义的类使用相同的名称,并尝试在类名之前添加命名空间,例如Inherits="namespace._Default".

Error 4 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).

【讨论】:

    【解决方案2】:

    如果您已经检查过:继承属性、代码文件属性、命名空间,但仍然有问题,则可能是 web.config 问题(pageBaseType)。

    <configuration>
    <appSettings>
        ...
    </appSettings>
    <connectionStrings/>
    <system.web>
        <pages pageBaseType="System.Web.UI.Page" />
    ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多