ASP.NET MVC的GoDaddy的不工作(不主域部署) [英] ASP.NET MVC on GoDaddy Not Working (Not Primary Domain Deployment)

查看:182
本文介绍了ASP.NET MVC的GoDaddy的不工作(不主域部署)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得ASP.NET MVC的GoDaddy的工作,我没有多少运气。我已阅读<一href=\"http://stackoverflow.com/questions/266205/is-there-a-way-that-i-can-run-a-aspnet-mvc-project-on-godaddycom-shared-web-hos\">post在这样涵盖的主题,但我必须有一个稍微不同的配置,或者必须是缺少服用点一路上因为主要的MVC页面出现,但所有的链接似乎忽视,没有调整的URL的数量似乎得到它的工作。一个小回地面。我有很多领域单一的托管计划指着主域名的子文件夹。基本ASP.NET Web窗体页工作得很好,但我当然想尝试在这些非主域内举办一个样本MVC的网站。你可以去到URL 这里。正如你可以看到这第一页出现,但如果你点击主页或关于它不工作。点击主页创建该链接的http://www.j$p$pscottsanders.com/jps/并单击关于创建这个链接的http://www.j$p$pscottsanders.com/jps/Home/关于。正如你所看到JPS在那里偷偷,这当然是我放在我的web应用程序文件的子文件。我想知道,如果这是一个MVC相关的问题或GoDaddy的问题。我怀疑MVC可能要在网站的根目录下坐下,而当它把JPS进入网址,它打破了路由机制(但是这是猜想)。我知道说,这是可能的,所以我希望他看到这一点,并帮助我得到这个部署战略的底部为MVC。

I am trying to get ASP.NET MVC working on GoDaddy and I'm not having much luck. I have read the post on SO that covers the subject, but I must have a slightly different configuration or must be missing somehting along the way because the main MVC page comes up, but all links seem to fail and no amount of tweaking the URLs seems to get it to work. A little back ground. I have a single hosting plan with many domains pointed to sub folders of the main domain. Basic ASP.NET web forms pages work just fine, but of course I wanted to try and host a sample MVC site in one of these non-primary domains. You can go to the URL here. As you can see this first page comes up, but if you click on Home or About it doesn't work. Clicking on Home creates this link "http://www.jprescottsanders.com/jps/" and clicking on about creates this link "http://www.jprescottsanders.com/jps/Home/About". As you can see JPS sneaks in there, this of course is the sub folder that i place my web app files in. I would like to know if this is a MVC related issue or a GoDaddy issue. I suspect that MVC may want to sit in the root directory of the site, and when it puts the "jps" into the URLs it breaks the routing mechanisms (but this is conjecture). I know Dan said this was possible so I'm hoping he sees this and helps me get to the bottom of this deployment strategy for MVC.

推荐答案

我也跟着上的 Haacked的网站。同时通过他走路的最底部谈到在虚拟目录和必须在Default.aspx.cs文件中所做的更改depoloying。基本上,您需要在下面的调用添加假:

I followed the following instructions on Haacked's site. At the very bottom of the walk through he talks about depoloying in a virtual directory and a change that must be made in the Default.aspx.cs file. You basically need to add false in the following call:

HttpContext.Current.RewritePath(Request.ApplicationPath, false);

这似乎已经解决了大部分问题,我

This seems to have resolved the bulk of my issues.

这篇关于ASP.NET MVC的GoDaddy的不工作(不主域部署)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆