Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何修复asax文件中的MVC解析器错误?_Asp.net_Asp.net Mvc - Fatal编程技术网

Asp.net 如何修复asax文件中的MVC解析器错误?

Asp.net 如何修复asax文件中的MVC解析器错误?,asp.net,asp.net-mvc,Asp.net,Asp.net Mvc,我正在创建一个网站几乎2周,一切都很好。休息两天后,我在解析方面出错。我试图运行我的代码,但它显示了一个错误 错误为: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; namespace SeyahatSitesi {

我正在创建一个网站几乎2周,一切都很好。休息两天后,我在解析方面出错。我试图运行我的代码,但它显示了一个错误

错误为:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace SeyahatSitesi
{
public class MvcApplication : System.Web.HttpApplication
{
    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }
}
Satır 1:

我查了asax文件,名字没问题。有什么问题

Global.asax.cs文件:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace SeyahatSitesi
{
public class MvcApplication : System.Web.HttpApplication
{
    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }
}
}

Global.asax文件

<%@ Application Codebehind="Global.asax.cs" Inherits="SeyahatSitesi.MvcApplication.Global" Language="C#" %>

继承的
不正确,请检查下面的正确继承

<%@ Application Codebehind="Global.asax.cs" Inherits="SeyahatSitesi.MvcApplication.Global" Language="C#" %>


我做了,但它不起作用。仍然是相同的错误。能否显示Global.asax.cs,包括它的namespace.using系统;使用System.Collections.Generic;使用System.Linq;使用System.Web;使用System.Web.Mvc;使用System.Web.Optimization;使用System.Web.Routing;命名空间SeyahatSitesi{public class mvcapapplication:System.Web.HttpApplication{protected void Application_Start(){AreaRegistration.Registeralareas();FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);RouteConfig.RegisterRoutes(RouteTable.Routes);BundleConfig.RegisterBundles(BundleTable.Bundles);}}}}}您打算将全局重命名为MVCAPApplication吗?不要将全局asax代码放在注释中。把它放在你的帖子里,更新。好的,我做了,你现在可以看了