简体   繁体   中英

IIS Hosted Project on Virtual Machine not resolving localhost for Scripts

I have a Published ASP .NET MVC web project running in IIS within a VMWare Virtual Machine(Windows 7). I am able to log in to the VM and navigate across the application from within the VM itself, but all content files(JS, CSS) are returning a 404 error.

ie : ' http://localhost/WebProject/Home/Index ' loads fine, but, ' http://localhost/WebProject/Scripts/Home/IndexScript.js ' within that page throws a 404 error.

Any ideas?

If you can access IIS on your VMWare it means that your IIS works fine and VMWare too but there some settings which restrict access to some urls or url is wrong.

Are you sure that you have file at path /Scripts/Home/IndexScript.js'

If yes then check

IIS not serving static content (css/js/images, etc) 404

IIS7 returns 404 on some static files, not others

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