Fonts files are not being included when publishing MVC application VS2013

允我心安 提交于 2019-12-21 09:38:14

问题


I have integrated (Twitter)Bootstrap to my ASP.NET MVC (4) application. In my source code I have the following 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:

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?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/20563752/fonts-files-are-not-being-included-when-publishing-mvc-application-vs2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!