未从View(cshtml)加载Asp.net MVC .properties文件

ish*_*iar 4 asp.net-mvc razor

我正在做一个asp.net mvc项目。在view(cshtml)页面中,我必须加载具有几个扩展名的多个外部资源。所有具有扩展名.css.js的资源都正在加载。但是,我有一个文件包含扩展名.properties不在同一进程中加载​​。我不知道如何解决。

错误是-

加载资源失败:服务器响应状态为404(未找到)

我的项目结构

-Project
    -Areas
        -Two
            -Library
                -pdfjs-1.5.188-dist
                    -web
                        -locale
                            -locale.properties
Run Code Online (Sandbox Code Playgroud)

我正在使用以下行在视图中加载locale.properties文件-

<link rel="resource" type="application/l10n" href="~/Areas/Two/Library/pdfjs-1.5.188-dist/web/locale/locale.properties">
Run Code Online (Sandbox Code Playgroud)

给定的路径是100%正确的。但是,在该路径上找不到资源。

谁能说出问题所在,如何解决???

小智 5

您必须在.properties文件中添加文件扩展名web.config

<system.webServer>
  <staticContent>
    <remove fileExtension=".properties" />
    <mimeMap fileExtension=".properties" mimeType="text/plain" />
  </staticContent>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)