Question

I have integrated (Twitter)Bootstrap to my ASP.NET MVC (4) application. In my source code I have the following fonts files:

Fonts Files

When I publish my application only the .svg file are being included in this fonts folder.

I have also this img folder being part of bootstrap:

Images

All images files are being included when I publish my application.

So, how can I get VS2013 to copy those fonts files when publishing the application?

Was it helpful?

Solution

A temporary solution,

Select your font files and Change Build action as Content from Properties Window. This fixes it in the immediate, but leaves you open to missing files in the future.

To permanently fix this issue this may help,

You can fix this permanently by modifying the default Build Action for font file extensions (.eot, .ttf, etc)

Visual-Studio-default-build-action-for-non-default-file-types

OTHER TIPS

I noticed that the "Precompile during publishing" checkbox in the "File Publish Options" in VS2017 prevented a *.lic file from being included in the deployment despite it being configured as "Content". A *.txt file did not have this problem, so I assume this has something to do with "unknown" file extensions. I'm not sure if this is specific to VS2017 or other versions also have this weird issue. Anyway thought I'd share this because it is very counter-intuitive, seems totally unrelated to that checkbox and might help somebody having similar issues.

In my case I was deploying to azure and below modification in the web.config fixed my problem.

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

Refer this link

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top