【发布时间】:2013-12-13 12:37:45
【问题描述】:
我已经通过 Stackoverflow、Google 进行了搜索,并尝试了不同的配置,例如 CodeFile 而不是 CodeBehind。错误略有变化,但仍然得到它,真的卡在这个上。任何帮助将不胜感激。确切的错误在下面,我的错误代码在下面。
“/”应用程序中的服务器错误。 解析器错误 说明:解析服务此请求所需的资源时出错。请查看以下特定的解析错误详细信息并适当地修改您的源文件。
解析器错误消息:无法加载类型“BestPricingEngine.Main”。
来源错误:
第 1 行: 第 2 行: 第 3 行:
源文件:/Pages/ImportFBAOrders/ImportFBAOrders.aspx 行:1
<%@ Page Title="Import FBA Orders" Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/MasterPage.Master" CodeBehind="ImportFBAOrders.cs" Inherits="BestPricingEngine.Main" %>
<%@ Register src="ImportFBAOrders.ascx" tagname="ImportFBAOrders" tagprefix="ucImportFBAOrders"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpSidebar" Runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cpMainContent" runat="server">
<ucImportFBAOrders:ImportFBAOrders ID="importFBAOrders" runat="server" />
</asp:Content>
【问题讨论】:
-
什么是 BestPricingEngine.Main?如果它是一个类库,那么它不应该是 BestPricingEngine.cs 吗?我不认识那个文件扩展名。
-
BestPricingEngine 是命名空间,Main 是 Main.aspx。我不明白它为什么要在那里加载 Main
-
嗯,有道理。您是否尝试在后面的代码中使用
Imports、Using或Inherits来引用命名空间?如果是这样,你在那里得到同样的错误吗?我只是好奇它是否可以找到命名空间。你手动添加了继承属性吗? -
CodeBehind="ImportFBAOrders.cs" Inherits="BestPricingEngine.Main" %>
-
我在代码中有这个。我删除 .Main 并收到无法加载 BestPricingEngine 的错误