Question

I'm using some custom opentype fonts in my Orchard CMS project. So I've added custom static content extensions for otf types:

 <staticContent>
    <mimeMap fileExtension=".otf" mimeType="font/opentype" />
  </staticContent>

And everything was ok, until I've tried to deploy everything on hosting. I've tried two different hosting smarterasp.com and parking.ru. Both website were returning an internal error. After some experiments I've found that problem appeared when hosting's server has it's own app.config which already had some MIME type bindings, and they were inherited by my web app. So I had manually remove everything I've added to web.config file. Should this Mime types be declared on global app.config on my developer machine? Why web app's local web.config was in conflict state with remote server's one? What is best practice for avoiding such errors?

Was it helpful?

Solution

You can just remove the offending global app.config mime-type in your web.config like so:

 <remove fileExtension=".otf" />
 <mimeMap fileExtension=".otf" mimeType="font/opentype" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top