0

I've developed an ASP.NET 4.5 website and ran it successfully on localhost.

When deploying it to IIS and viewing the website the CSS/JS/Images failed to load. The console showed:

enter image description here

Note I am using Bundle Config to load these files. E.g in my _Layout.cshtml file:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Styles.Render("~/Content/animate")
    @Styles.Render("~/Content/lightbox")
    @Styles.Render("~/Content/nice-select")
    @Styles.Render("~/Content/owl-carousel")

</head>
<body>
    @RenderBody()
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/popper")
    @Scripts.Render("~/bundles/bootstrap")
    @Scripts.Render("~/bundles/stellar")
    @Scripts.Render("~/bundles/lightbox")
    @Scripts.Render("~/bundles/nice-select")
    @Scripts.Render("~/bundles/isotope")
    @Scripts.Render("~/bundles/owl-carousel")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/animate")
    @Scripts.Render("~/bundles/flipclock")
    @Scripts.Render("~/bundles/theme")
    @RenderSection("scripts", required: false)
</body>
</html>

I enabled static content on IIS as well as set Anonymous Authentication to true which the sister question answer used

enter image description here

I do not know what else to do.

I can provide more info if needed

Jebathon
  • 4,310
  • 14
  • 57
  • 108

2 Answers2

0

Sometimes you need to Enable Directory Browsing located in your IIS

Features View

Check also the user rights of all folders deployed or to that specific folder. If you have a full access into it.

Right Click the project folder and Properties.

Check also the application pool => Advance Settings =>Enable-32-Bit Application == true or false;

You can choose as default to 32 bit

Or is your files are included to the deployment server?

Hope it helps.

Vijunav Vastivch
  • 4,153
  • 1
  • 16
  • 30
0

would you please check the static resource folder has granted access to IIS and Application Pool user? Network and Network Service account would be accountable for IIS Next step you can check if you have denied Anonymous access in Authorization Rules(Not Authentication)