【问题标题】:What does "could not load type <Namespace>.<Module>" mean?“无法加载类型 <Namespace>.<Module>”是什么意思?
【发布时间】:2014-05-16 23:01:50
【问题描述】:

我正在尝试在 Microsoft Visual Studio 2010 中为多个不同的项目同时设置 ASP.NET Web 应用程序的构建环境。我使用 IIS 7.5 作为后端服务器。我在所有三个项目中都遇到了相同形式的编译错误,其中有一些细微的上下文差异。在 VS 2010 中构建生成的错误消息如下(我添加了一个 # 符号以便我可以单独引用它们)。

Could not load type 'divFetch.Global' (#1)
Could not load type 'OrderAdmin.ContractorProductivity' (#2)
Could not load type 'Ticket.forms.Ticket_summary' (#3)

供您参考,我正在使用以下 Page 指令(均在与上述文件相对应的文件中定义,扩展名为 .aspx [除了#1 和 .asax]):

<%@ Page language="c#" Codebehind="pleasewait.aspx.cs" AutoEventWireup="false" Inherits="Ticket.pleasewait" %>
<%@ Page language="c#" Codebehind="LogTicket_summary.aspx.cs" AutoEventWireup="false" EnableViewState="true" Inherits="Ticket.forms.Ticket_summary" %>
<%@ Page language="c#" Codebehind="ContractorProductivity.aspx.cs" AutoEventWireup="false" Inherits="OrderAdmin.ContractorProductivity" %>
<%@ Application Codebehind="Global.asax.vb" Inherits="divFetch.Global" %>

其中,我注意到 Resharper 以红色突出显示“divFetch.Global”、“ContractorProductivity”和“Ticket_summary”,以蓝色突出显示“OrderAdmin”和“Ticket.forms”。

我已经看过 "Could not load type [Namespace].Global" causing me grief 和 Could not load type 'XXX.Global' 但这些对我没有用(至少现在还没有)。所以我想问一个不同的问题:为什么会出现这个错误?

在 #2 和 #3 的情况下,为什么 Visual Studio 不喜欢这些特定的模块,而像“Ticket.pleasewait”这样的其他模块都很好?

【问题讨论】:

  • 你的网站是编译的还是网站的?

标签: c# asp.net visual-studio-2010 iis-7.5


【解决方案1】:

问题似乎是您需要使用 CodeFile 更改 CodeBehind。有关您为什么可以访问此其他帖子的信息:

CodeFile vs CodeBehind

【讨论】:

    猜你喜欢
    • 2022-06-12
    • 1970-01-01
    • 1970-01-01
    • 2011-11-05
    • 1970-01-01
    • 2015-02-20
    • 1970-01-01
    • 1970-01-01
    • 2012-01-22
    相关资源
    最近更新 更多