ASP.NET Core无法找到此localhost页面 [英] ASP.NET Core This localhost page can’t be found

查看:4276
本文介绍了ASP.NET Core无法找到此localhost页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人遇到过这种问题?我认为它与IIS有关...我正在使用IIS 10也使用VS2017和ASP.NET Core。当我启动应用程序时,我看到了这个错误:


无法找到此localhost页面



未找到网址的网页:

解决方案

当我意识到我在StartUp类'配置方法中意外删除了默认路由时解决了这个问题:

  app.UseMvc(routes => 
{
routes.MapRoute(
name:default,
模板:{controller = Home} / {action = Index} / {id?});
});


Does anyone encountered this kind of problem? I think it has something to do with the IIS or so... I am using IIS 10 also using VS2017 and ASP.NET Core. When I launch the application I saw this error:

This localhost page can’t be found

No webpage was found for the web address: http://localhost:44306/

I tried changing the port. But nothing works. I tried other application it works but only this project having this kind of error and I don't know why.

Any Idea how to fix this?

Update:

解决方案

I solved this problem when I realized I had accidentially removed the default route in the StartUp class' Configure method:

        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");
        });

这篇关于ASP.NET Core无法找到此localhost页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆