访问SCD中的静态文件 [英] Accessing static files in SCD

查看:72
本文介绍了访问SCD中的静态文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET CORE 应用程序中,我正在使用 wwwroot 文件夹中的静态文件。在 dotnet运行的情况下运行
index.html 文件在<$ c处正常显示$ c> localhost:port / ,但在将应用程序发布为 SCD 自包含开发包后,运行。 exe 生成的文件中,静态文件不会显示在 localhost:port / 中。

In the .NET CORE application, I'm using static files in wwwroot folder. while running it as dotnet run the index.html file is displayed smoothly and normal at localhost:port/ but after publishing the app as SCD self-contained development package, and run the .exe generated file, the static files are not displayed at the localhost:port/.

在浏览器的开发人员屏幕中,出现 404错误,找不到文件。

In the developer screen of the browser, I got 404 error that is file not found.

推荐答案

在您的 project.json 中添加相应的语句:

Add the corresponding statement in your project.json:

  "publishOptions": {
    "include": [
      "wwwroot",
      "appsettings.json",
      "web.config"
    ]
  },

这篇关于访问SCD中的静态文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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