访问SCD中的静态文件 [英] Accessing static files in 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屋!