.OTF字体未部署到Azure

bwb*_*ing 22 asp.net-mvc azure

我在/ images文件夹中有一个带有.otf字体的MVC 4应用程序.它适用于我的桌面,但当我部署到azure时,我在尝试访问/images/myfont.otf时得到404

该字体已将Build Action属性设置为'Content'

我如何强制Azure选择它?

MEM*_*ark 36

您可能需要配置IIS以正确提供此文件类型.您可以通过在以下<system.webServer>元素中添加以下内容来执行此操作Web.config:

<staticContent>
    <mimeMap fileExtension=".otf" mimeType="font/otf" />
</staticContent>
Run Code Online (Sandbox Code Playgroud)

更多信息 http://www.big.info/2013/06/how-to-use-otf-opentype-format-fonts-on.html


kyl*_*rns 6

请将下列web.config的system.webServer配置:

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