0

I am trying to host asp.net application in IIS7. I am using published version of application. when i run it all css and javascripts are not loading. the strange is when i run from visual studio it working fine.

error in browser console like this : Failed to load resource: the server responded with a status of 404 (Not Found)

I analyse the issue and come to know that css and js path is not correct. you can see in below image. it is http://localhost/css/bootstrap.css but it should be http://localhost/MICPA1/css/bootstrap.css

Browser console error.

I have used bundle for css and js like MVC.

bundles.Add(new StyleBundle("~/bundles/commonStyle").Include(
            "~/css/bootstrap.css",
            "~/css/style.css",
            "~/css/datepicker.css"
            ));

        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
            "~/Scripts/jquery.min.js"));

        bundles.Add(new ScriptBundle("~/bundles/commonJquery").Include(
            "~/Scripts/bootstrap.min.js",
            "~/Scripts/script.js"));

I also tried simple link tag but it is also not working.

1 Answer 1

1

The problem is with the IIS,It is not serving Static Content, which you can set up as diplayed in the image

enter image description here

if you have checked that and it still does not work then what you need to do is set the identity of the anonymous authentication to the Application Pool Identity if it is on specific user here is an image of where that is.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.