简体   繁体   中英

Deployed web on Azure cannot access a .less file (error code 404). Local IIS deployment works without error

I deployed a website in https://pokegotool.azurewebsites.net .

However, when I use a browser to access it and read the browser console, it told that the "Content/pre-css/styles.less" file is inaccessible (error code 404).

I build the web site locally in IIS and it had no such problem as the file is loaded successfully. I am sure that the file exists in Azure deployment place.

This URL is ZIP archived project: https://www.mediafire.com/file/i6745pz5j43cw2z/RangeGen.zip/file

Feel free to use it.

Is this an error from Azure or from my project itself? How could I fix it?

I have deployed your project and met the same issue . Basically , it is due to that Azure app service IIS server have not mapped correct MIME type for .less files by default.

To solve this issue , just adding a map record in your web.config file as below : 在此处输入图片说明

 <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".less" mimeType="text/plain" />
     </staticContent>
 </system.webServer>

It works on my app service , try it here : https://rangegen20190902101335.azurewebsites.net/Content/pre-css/styles.less

Pls mark me if it solves your issue : )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM