![](/img/trans.png)
[英]Static files on local machine not being published to IIS from visual studio
[英]Prevent Visual Studio Dev server, IIS Express and full IIS from processing static files
使用 Visual Studio 2010,我今天在Application_AuthenticateRequest
上設置了一個斷點,並注意到對我的圖像、css 和 js 的請求正在處理中。 我將我的 web 應用程序項目切換為使用 IIS Express,然后使用完整的 IIS,我的斷點仍然在那些 ZA82627ZD4D4C 文件上命中
我的印象是,至少完整的 IIS 默認不會通過 ASP.NET 管道提供這些文件。 我在這里想念什么?
我建議將您的 static 文件放在單獨的子域上並使用 AWS S3
您需要確保 IIS 設置為提供 static 內容。
見這里。
我最終將此添加到我的 web.config 中。 我知道我所有的 static 文件都將存在於這些文件夾中,因此可以滿足我的需要。
<location path="scripts, styles, images">
<system.web>
<authentication mode="None" />
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.