AppHarbor上的nopCommerce.重定向循环

chg*_*chg 3 asp.net asp.net-mvc nopcommerce appharbor

我正在尝试将nopCommerce应用程序部署到AppHarbor.

当我启动页面时,我遇到了运行时重定向循环.我添加了一些调试日志记录,问题似乎是Global.asax.cs中的这一部分 - > EnsureDatabaseIsInstalled():

if (!webHelper.GetThisPageUrl(false).StartsWith(installUrl, StringComparison.InvariantCultureIgnoreCase))
            {
                this.Response.Redirect(installUrl);
            }
Run Code Online (Sandbox Code Playgroud)

StartsWith比较始终为false,因为GetThisPageUrl返回 http://[name].apphb.com:14275/install

和installUrl(通过GetStoreLocation)返回 http://[name].apphb.com/install

有没有人能够让nopCommerce与AppHarbor一起工作?

Tro*_*sen 6

您似乎需要修改nopCommerce以省略端口号.我快速浏览了一下源代码,似乎有两种可能的解决方案:

1)从改变布尔参数false,以trueEnsureDatabaseIsInstalled方法应导致GetThisPageUrl选择一个不同的分支生成该URL不具有端口号的方法.

2)更新GetThisPageUrl方法("WebHelper.cs")中的else分支以忽略端口号.

选择第一个解决方案更容易,但在核心修补问题会更好,所以你不会遇到类似的问题.