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

3
我在Microsoft Azure的"~/css/fonts/"目录下有一个.svg文件。当我发布网站时,所有的CSS和EOT文件都被发布了,但是我的唯一的.svg文件却没有被发布。
我已经阅读过其他SO帖子,其中提到我们必须在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。

你是如何发布的?使用哪个应用程序/来源? - viperguynaz
Visual Studio 2013专业版 - Jed
在Visual Studio中右键单击svg文件,选择属性,然后检查“生成操作”是否设置为“内容”。 - viperguynaz
还有一个问题 - FTP 部署,还是通过“发布”? - viperguynaz
我检查了“生成操作”,它被设置为“内容”。我通过“发布”上传了网站。 - Jed
1个回答

5

我犯了一个错误,把<staticContent>添加到了位于Views文件夹中的web.config中(在我的MVC5 proj中),而不是将<staticContent>放在项目根目录下的Web.config文件中。

一旦我将内容移动到正确的.config文件中,我的.svg现在可以被发布了。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接