无法将.SVG文件发布到Azure网站

时间:2014-08-19 20:29:25

标签: azure svg web-config mime

我的Microsoft Azure "~/css/fonts/"目录中有一个.svg文件。当我发布网站时,我的所有css和eot文件都被发布,我的唯一.svg文件没有。

我已阅读other SO posts,提到我们必须明确将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。

1 个答案:

答案 0 :(得分:5)

我错误地将<staticContent>添加到位于web.config文件夹中的Views(在我的MVC5项目中),而不是将<staticContent>放在Web.config中1}}位于项目根目录中的文件。 :\

将内容移动到正确的.config后,我的.svg现在正在发布。