如何在不使用visual studio的情况下在azure托管网站中包含非标准字体



尝试在一个简单的静态内容网站上使用自定义字体,通过git发布到azure。网站项目没有封装在Visual studio解决方案中。没有网。配置,所以我怎么能得到自定义字体工作或任何静态内容,如。json文件是可访问的?

这个解决方案意味着你使用visual studio,我不是。如何在azure中包含非标准字体?

我的准确错误是:

Failed to load resource: the server responded with a status of 404 (Not Found) http://fakewebsitename.azurewebsites.net/fonts/fontawesome-webfont.woff?v=4.0.3

你只需要为你的web.config字体添加一个MIME类型它看起来就像这样为你的woff字体

<configuration>
    <system.webServer>
        <staticContent>
            <remove fileExtension=".woff" /> 
            <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
         </staticContent>
    </system.webServer>
</configuration> 

默认情况下,IIS将阻止下载未指定MIME类型的静态文件。

编辑:添加<remove fileExtension=".woff" />基于@TealFawn建议

最新更新