首页 文章

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

提问于
浏览
3

我有一个.svg文件位于我的Microsoft Azure "~/css/fonts/" 目录中 . 当我发布网站时,所有的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 回答

  • 5

    我做了添加 <staticContent> 到的错误的 web.config 地处 Views 文件夹(在我的MVC5凸出),而不是放置 <staticContent> 在位于在我的项目的根目录中的文件 Web.config . :\

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

相关问题