I deployed MVC 4 application to Arvixe.com hosting. In local everything is okay, site opens full, but after deploying, site opens, but, not full. css, jquery, javascript is not working. Only html tags seem. Arvixe support send this to me: How to Bin Deploy ASP.NET Assemblies on Shared Servers. But I can not understand it well. Can anybody help me to find that why site does not open full? What shloud I check to solve this?
Asked
Active
Viewed 234 times
0
-
1My guess would be that your links are relative? Without seeing **any** code, we couldn't say for sure. – Mathew Thompson Mar 19 '13 at 11:55
-
1Use a browser debugging tool like Firebug or Chrome dev tools and monitor the network requests for the page resources. How does the server respond to those requests? That should give you an indication of what's wrong. (For example, if it's a 404 response, then the files aren't where you think they are on the server.) – David Mar 19 '13 at 11:58
-
1first of all try to check application pool of your application if u have access to iis options. application pool "framework" option must be set to 4.0. IIS creates pools with .net 2.0 by default. – maxs87 Mar 19 '13 at 12:00
1 Answers
1
When linking your views and resources you should use relative paths
instead of
"Views/MyView.aspx"
use
"~/Views/MyView.aspx"
This is valid for all resources in your application and it is know to cause these problems.
When working locally the paths are correct since it's all resolved to your computer.
In a web environment you will have to use the relative path so the url is resolved in front of all your resources.

JMan
- 2,611
- 3
- 30
- 51
-
I have used Layout = "~/Views/Shared/_Layout.cshtml" and other links are like "~/Content/styles/myStyle.css", "~/Scripts/jquery.min.js", href="@Url.Action("Create", "Product")" etc.. – Jeyhun Rahimov Mar 19 '13 at 12:14
-
-
Open your site in IE, then go to the Console tab, you have an indication there ;) – JMan Mar 19 '13 at 12:27
-
1There is some issue with loading your content. Are you sure ASP MVC is supported? you can try to publish your site onto your local IIS. This detaches your solution from your visual studio and if there is any problem with the deployment it will be present as well and you will be able to do some extensive debugging. including attaching your debugger to the w3wp process. – JMan Mar 19 '13 at 12:37
-
I check it in local, problem is BundleConfig. I commented this line: @Styles.Render("~/Content/styles"), site in local also seem like hosting. Do you any idea, why BundleConfig not working for css files? – Jeyhun Rahimov Mar 19 '13 at 12:49
-
I found solution, you directed me that. thanks. I set debug=true, then bundle worked:
– Jeyhun Rahimov Mar 19 '13 at 12:54