index.html未显示为默认页面

我已经创建了一个的.NET的核心Web应用程序,在wwwroot我的index.html的未加载默认页面,当我明确地调用它只会加载。

这是我的project.json

{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel"
  },

  "frameworks": {
    "dnxcore50": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules"
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ]
}

这是我的启动:

public class Startup
{
    // This method gets called by the runtime. Use this method to add services to the container.
    // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
    public void ConfigureServices(IServiceCollection services)
    {
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app)
    {
        app.UseStaticFiles();
    }

    // Entry point for the application.
    public static void Main(string[] args) => WebApplication.Run<Startup>(args);
}
安迪·科涅涅夫(Andy Korneyev)

您必须添加

app.UseDefaultFiles();

app.UseStaticFiles();Configure方法之前

有关更多详细信息,请参见文档

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

为什么phonegap应用程序在覆盖index.html之后总是显示自己的默认页面

来自分类Dev

为什么phonegap应用程序在覆盖index.html之后总是显示自己的默认页面

来自分类Dev

Node.js:如何使默认页面成为…… 除了index.html

来自分类Dev

SPA默认页面中间件无法返回默认页面'/index.html',因为找不到默认页面,并且没有其他中间件处理请求

来自分类Dev

为什么我得到Apache2 Ubuntu默认页面而不是自己的index.html页面?

来自分类Dev

果园未显示默认页面

来自分类Dev

发布.netcore角度项目给出“ SPA默认页面中间件无法返回index.html”,可在调试中工作

来自分类Dev

Apache显示默认页面VHOST页面

来自分类Dev

使用 vue.js 时如何在 index.js 中配置路由器视图默认页面

来自分类Dev

为项目提供默认页面

来自分类Dev

任何虚拟主机的默认 index.html 页面

来自分类Dev

由于括号,Google Chrome默认页面为file:///opt/brackets/www/LiveDevelopment/launch.html

来自分类Dev

除非NgRoutingUsePushState设置为false,否则不会为index.html显示默认视图。为什么?

来自分类Dev

NGINX默认页面

来自分类Dev

将XAMPP默认页面保留为开发网站

来自分类Dev

在Visual Studio 2010上将登录设置为默认页面

来自分类Dev

无法为数据表应用默认页面长度

来自分类Dev

在浏览器地址中显示默认页面

来自分类Dev

在导航栏上突出显示默认页面当前菜单

来自分类Dev

尝试配置后,Apache2仍显示默认页面

来自分类Dev

Apache显示/代替默认页面的索引?

来自分类Dev

如何更改Adobe Reader的默认页面显示?

来自分类Dev

AWS-显示Tomcat默认页面而不是Webapp主页

来自分类Dev

显示Apache默认页面,但未找到Apache

来自分类Dev

图片未显示在页面上-在新标签页中打开会显示index.php

来自分类Dev

Angular默认页面路由

来自分类Dev

使url匹配“ /”,“ / index”和“ /index.html”为单个状态

来自分类Dev

填充JSDoc index.html页面

来自分类Dev

如果找不到页面,则转到默认页面,而不是显示404

Related 相关文章

  1. 1

    为什么phonegap应用程序在覆盖index.html之后总是显示自己的默认页面

  2. 2

    为什么phonegap应用程序在覆盖index.html之后总是显示自己的默认页面

  3. 3

    Node.js:如何使默认页面成为…… 除了index.html

  4. 4

    SPA默认页面中间件无法返回默认页面'/index.html',因为找不到默认页面,并且没有其他中间件处理请求

  5. 5

    为什么我得到Apache2 Ubuntu默认页面而不是自己的index.html页面?

  6. 6

    果园未显示默认页面

  7. 7

    发布.netcore角度项目给出“ SPA默认页面中间件无法返回index.html”,可在调试中工作

  8. 8

    Apache显示默认页面VHOST页面

  9. 9

    使用 vue.js 时如何在 index.js 中配置路由器视图默认页面

  10. 10

    为项目提供默认页面

  11. 11

    任何虚拟主机的默认 index.html 页面

  12. 12

    由于括号,Google Chrome默认页面为file:///opt/brackets/www/LiveDevelopment/launch.html

  13. 13

    除非NgRoutingUsePushState设置为false,否则不会为index.html显示默认视图。为什么?

  14. 14

    NGINX默认页面

  15. 15

    将XAMPP默认页面保留为开发网站

  16. 16

    在Visual Studio 2010上将登录设置为默认页面

  17. 17

    无法为数据表应用默认页面长度

  18. 18

    在浏览器地址中显示默认页面

  19. 19

    在导航栏上突出显示默认页面当前菜单

  20. 20

    尝试配置后,Apache2仍显示默认页面

  21. 21

    Apache显示/代替默认页面的索引?

  22. 22

    如何更改Adobe Reader的默认页面显示?

  23. 23

    AWS-显示Tomcat默认页面而不是Webapp主页

  24. 24

    显示Apache默认页面,但未找到Apache

  25. 25

    图片未显示在页面上-在新标签页中打开会显示index.php

  26. 26

    Angular默认页面路由

  27. 27

    使url匹配“ /”,“ / index”和“ /index.html”为单个状态

  28. 28

    填充JSDoc index.html页面

  29. 29

    如果找不到页面,则转到默认页面,而不是显示404

热门标签

归档