C# &引用;资源找不到或暂时不可用“;ASP.NET MVC 5中出现错误

C# &引用;资源找不到或暂时不可用“;ASP.NET MVC 5中出现错误,c#,asp.net-mvc,C#,Asp.net Mvc,您正在查找的资源(或其依赖项之一)可能 已被删除、名称已更改或暂时 不可用的请检查以下URL并确保它是正确的 拼写正确 Index.cshtml @{ ViewBag.Title = "Index"; Layout = "Null"; } <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</titl

您正在查找的资源(或其依赖项之一)可能 已被删除、名称已更改或暂时 不可用的请检查以下URL并确保它是正确的 拼写正确

Index.cshtml

@{
    ViewBag.Title = "Index";
    Layout = "Null";
}

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
        <p>Welcome to the first application of MVC</p>
    </div>
</body>
</html>

确保在App_Start文件夹的yout RouteConfig.cs文件中,控制器名称为“first”

并且,在Mvc\Views文件夹中创建一个名为“first”的文件夹,并将Index.cshtml放在第一个文件夹中,然后执行项目

有关详细信息,请查找以下URL:


您想访问哪个URL?(我强烈建议使用更传统的支撑样式,并遵循.NET命名约定,顺便说一句)您的路线是什么样子的?firstcintroller.cs?更改此文件的名称yournameController
namespace mvcapp.Controllers
{ 
    public class firstController : Controller
    {
        // GET: first
        public ActionResult Index()
        {
            return View();
        }
    }
}