c# - 当我运行解决方案时,它打开的不是 mvc 中的默认页面

标签 c# .net asp.net-mvc routeconfig

public class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );

    }

不知道为什么在这个位置打开了http://localhost:00000/Views/Dashboard/Index.cshtml

什么能做到这一点?

最佳答案

试试这个

1) 右击你的项目解决方案

2)选择属性

3) 选择 Web 选项,然后选择当前页面

关于c# - 当我运行解决方案时,它打开的不是 mvc 中的默认页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38713261/

相关文章:

c# - 发布一个可执行文件

c# 数学运算的泛型方法

c# - ModalPopUpExtender 内的 Gridview 导致 ModalPopUpExtender 关闭

c# - 尝试替换 connectionStrings 元素以在 Visual Studio Team Services 中进行持续部署

c# - PM 给我 ERROR : Type is not resolved for member. .on any migration command

c# - SQLite-net Table<>()方法调用性能

c# - 如何有效地转换 List<T>?

c# - 使用 HtmlAgilityPack 获取 iframe 源

C# 使用 MySQL 从 EF6 Code-First DB 获取错误的十进制值

asp.net-mvc - 如何更改 Kendo MVC Treeview 的父字体