Issue with MVC app when publishing but runs fine when debugging in VS2010

Messugga

Honorary Master
Joined
Sep 4, 2007
Messages
13,051
Reaction score
3,205
Location
Pretoria
So I've been struggling with this issue for a bit and it's really frustrating. I have a MVC application that works perfectly when I debug it in VS2010 and also when I publish it to my local system using Web Deploy. Unfortunately the target server is still running Win2003 and thus IIS6 which doesn't exactly support Web Deploy very well, not to mention that rights will be an issue when it comes to publishing once it moves to production.
When I publish to a path however, I see some anomalies. A specific link and the page it points to becomes unavailable. The link disappears from the menu (Telerik) and the page throws a 404 if you enter the URL manually. It's either IIS6 parsing the site incorrectly or the publishing that goes wrong. I'll try publishing to a folder location and running the site on an IIS7 system, but if memory serves that showed the same results which is why I was thinking it may be publishing settings.

Do you guys perhaps have any suggestions for me as to settings I can check with regards to publishing or anything else that may lead me to a solution?
 
Just a random thought makes me think its a relative path issue. There are quite a few differences between running under IIS vs running in the internal asp.net dev server. For asp.net server controls try make paths use the ~ like "~/images/myimage.jpg" instead of "/images/myimage.jpg" The ~ will make it relative to the "home folder" of the asp.net app. For client side script its a bit more tricky as it cant make use of the ~, so for that do something like "./images/myimage.jpg" and if your scripts/pages are in subfolders, make sure to make the necessary changes so the relative path works. Relative paths will make your project a lot more portable.

Otherwise for debugging to try and figure out what has gone wrong, look at Firebug plugin for Firefox and also the Fiddler 2 intercepting proxy. These 2 tools can help you pinpoint missing resouces and/or path errors that may not be immediately apparent. And last of all, if none of this helps, perhaps try ask at http://www.stackoverflow.com/

Regards,

Steed.
 
Top
Sign up to the MyBroadband newsletter
X