我的Microsoft Azure"~/css/fonts/"
目录中有一个.svg文件。当我发布站点时,所有的css和eot文件都由我的一个发布,只有.svg文件没有发布。
我已经阅读了其他SO帖子,其中提到我们必须显式添加mimeMaps
到web.config
,因此我已经更新/发布web.config
了以下内容:
<system.webServer>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
</system.webServer>
...,然后重新发布特定的.svg文件,但出现以下错误:
Preparing to publish files...
Using ID 'dc2a......' for connections to the remote server.
Using ID 'a2c7......' for connections to the remote server.
Using ID '9720......' for connections to the remote server.
Using ID 'aff7......' for connections to the remote server.
Using ID '4d1d......' for connections to the remote server.
The synchronization is being stopped because the maximum number of sync passes '5' has been exceeded even though all the changes could not be applied. This could occur if there are external changes being made to the destination.
仅当我尝试上载.svg文件时才会发生上述错误(我拥有的所有其他文件类型都不会引发此错误。)
发布.svg文件还需要做些其他事情吗?
注意:我正在使用VS2013 Pro将网站发布到Windows Azure。
我犯了一个错误,将其添加<staticContent>
到web.config
位于Views
文件夹中(在我的MVC5项目中)而不是将其放置<staticContent>
在Web.config
项目根目录中的文件中。:\
将内容移动到正确的.config后,.svg现在已发布。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句