【问题标题】:Need help on following error Could not load type 'AccountWeb.Global'需要有关以下错误的帮助无法加载类型“AccountWeb.Global”
【发布时间】:2011-11-17 01:12:32
【问题描述】:

当我运行我的项目错误详细信息时出现以下错误。 解析器错误

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 'AccountWeb.Global'.

Source Error:

Line 1:  <%@ Application Codebehind="Global.asax.cs" Inherits="AccountWeb.Global" Language="C#" %>


Source File: /global.asax    Line: 1 

非常感谢任何帮助。

【问题讨论】:

    标签: asp.net web-applications configuration global-asax


    【解决方案1】:

    对于稍后遇到此问题的任何人 - 值得一提的是,您还需要确保将您的网站构建到 /bin 目录。例如,如果您添加了自己的构建配置,则需要进入站点项目的属性并确保将输出路径设置为 /bin。

    -m

    【讨论】:

    • +1。这个答案应该被投票赞成。在使用 VS 配置项目时,不得不乱搞这些设置是非常令人沮丧的。因此浪费了很多时间。
    【解决方案2】:

    您的 Global.asax.cs 的内容是什么?该错误表示命名空间或类名不匹配,两者都必须匹配。

    所以你的 .cs 文件必须看起来像

    namespace AccountWeb
    {
        public class Global : System.Web.HttpApplication
        {
            ....
        }
    }
    

    【讨论】:

    • 感谢@blowdart,它帮助我解决了我的问题。
    • 对我来说命名空间不匹配,在我匹配之后才起作用。
    【解决方案3】:

    我通过授予文件夹的正确权限以及从 IIS 进行检查来解决此问题。

    当我在本地环境中进行测试时,我获得了所有人的许可。但在发布模式下,我认为我们只授予 ASP.Net 用户权限。

    【讨论】:

      猜你喜欢
      • 2023-03-08
      • 1970-01-01
      • 1970-01-01
      • 2016-09-03
      • 2010-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多