Base solution for your next web application
Open Closed

Published Webapplication FONT errors #4361


User avatar
0
michelmk2 created

Hi!

I'm using the ASP.NET MVC & Jquery template (version V5.0.4). The project works great locally, how ever if I publish it I'm getting font 404 errors.

If the image link doesn't work, use: <a class="postlink" href="https://imgur.com/fxeyjkO">https://imgur.com/fxeyjkO</a>

I've added the following to the web config, but that doesn't seem to work:

<staticContent>
      <remove fileExtension=".woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
      <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
    </staticContent>

If I check the network tab, i'm seeing that the fonts are giving me 404 errors.

Thanks in advance!


9 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @michelmk2,

    Do you get the same behaviour for other browsers ? Which browser you are working with ?

  • User Avatar
    0
    banksearch created

    Yes. All browsers are the same. Is there a way to add a screenshot here?

    I could see the difference between local and azure version. The difference is that even though fonts folder is in under wwwroot folder, When you open inspector in chrome browser and select Sources tab you cannot see fonts folder in the list. But when you open the application in the localhost then fonts folder appears in Sources tab.

    I have also updated "WebSiteRootAddress" in appsetings folder but still cannot get the fonts working in azure web app.

    Thanks,

  • User Avatar
    0
    aaron created
    Support Team

    Is there a way to add a screenshot here?

    You can click on Upload attachment below the Submit button. It's a problem of imgur.com — e.g. github.com images work.

  • User Avatar
    0
    rvanwoezik created

    I seem to have same problem publishing to azure

  • User Avatar
    0
    jims created

    I have the same issue. You might notice that the min files in *.Web.Mvc\wwwroot\view-resources\Areas\App\Views_Bundles are not updated.

    I went to the command line and navigated to the root folder of the *.Web.Mvc project where the gulpfile.js is located, and I ran gulp --prod to minify the production files.

    Publish the project and the updated min files should be included. It is clumsy, but it works.

  • User Avatar
    0
    rvanwoezik created

    Thanx Jims, your solutions works!

  • User Avatar
    0
    michelmk2 created

    <cite>JimS: </cite> I have the same issue. You might notice that the min files in *.Web.Mvc\wwwroot\view-resources\Areas\App\Views_Bundles are not updated.

    I went to the command line and navigated to the root folder of the *.Web.Mvc project where the gulpfile.js is located, and I ran gulp --prod to minify the production files.

    Publish the project and the updated min files should be included. It is clumsy, but it works.

    You're a hero man! Works like a charm.

  • User Avatar
    0
    tcon created

    Thanks for posting, we are experiencing the same problem too with our ci/cd implementation in vsts. Did you end up automating this fix so you don't have to manually minify and publish to prod?

  • User Avatar
    0
    alper created
    Support Team

    hi, You have to run the below code before you release.

    gulp --prod
    

    You can specify a visual studio build event for that. See <a class="postlink" href="https://msdn.microsoft.com/en-us/library/ke5z92ks.aspx">https://msdn.microsoft.com/en-us/library/ke5z92ks.aspx</a>