简体   繁体   English

解析器错误消息:无法加载类型'ObamPortal.Web.MvcApplication'

[英]Parser Error Message: Could not load type 'ObamPortal.Web.MvcApplication'

Source Error: 源错误:

*****Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="ObamPortal.Web.MvcApplication" Language="C#" %>***** *****第1行:<%@ Application Codebehind =“ Global.asax.cs” Inherits =“ ObamPortal.Web.MvcApplication” Language =“ C#”%> *****

Source File: /global.asax Line: 1 源文件:/global.asax行:1

I get this error when I am trying to debug an ASP.NET MVC 4.0 application using Visual Studio 2012. All the recommendations I saw here were for already deployed applications. 当我尝试使用Visual Studio 2012调试ASP.NET MVC 4.0应用程序时收到此错误。我在这里看到的所有建议都是针对已部署的应用程序的。 Mind you, I am using Windows 7 as OS. 请注意,我使用Windows 7作为操作系统。 How can I fix this? 我怎样才能解决这个问题?

My global.asax.cs is: 我的global.asax.cs是:

using ObamPortals.Core.Domain.Modules;
using ObamPortal.Web.Modules; 

namespace ObamPortal.Web 
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit go.microsoft.com/?LinkId=9394801 

    public class MvcApplication : System.Web.HttpApplication
    {
        public override void Init() 
        {
        }

        protected void Application_Start()
        {
        }
    }
} 

Try this following steps (any) 尝试以下步骤(任意)

1.) Close IDE and reopen 1.)关闭IDE,然后重新打开

2.) Perform a clean build 2.)执行干净的构建

3.) change the output path in project settings for the web app to Bin (rather than bin/x86/Debug) 3.)将Web应用程序的项目设置中的输出路径更改为Bin(而不是bin / x86 / Debug)

Did the app compile properly? 应用程序编译正确了吗? Usually the Inherits would include Global in it as : ObamPortal.Web.MvcApplication.Global 通常,Inherits会将Global包括在内:ObamPortal.Web.MvcApplication.Global

You need to make sure the Inherits matches exactly the namespace and class of the global.ascx.cs file. 您需要确保Inherits完全匹配global.ascx.cs文件的名称空间和类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM