【发布时间】:2018-09-19 12:02:08
【问题描述】:
我正在尝试创建一个 ASP.net Core 2.0 Web 应用程序;我已将静态文件放在名为 Content 的文件夹中。
我给出以下路径:
<link href="@Url.Content("../Content/css/style.css")" rel="stylesheet">
加载视图时出现 404 - not found 错误。但是 GET 请求路径是正确的,并且文件存在于同一路径中。这是执行 GET 请求的路径:
http://localhost:49933/Content/css/style.css
我找到了需要我更改 web.config 文件中的设置的解决方案,但 .Net Core 2.0 没有。我用过MVC。 web.config文件对IIS不是很重要吗?
【问题讨论】:
标签: asp.net .net asp.net-core asp.net-core-mvc asp.net-core-2.0