AppHarbor NopCommerce运行问题
我将nopcommerce解决方案上传到appharbor(使用此方法无法在appharbor下构建notcommerce项目)和解决方案成功构建,但我收到 403 错误 - 禁止:尝试打开页面时访问被拒绝(允许对文件系统的写访问设置为 true)。
感谢并希望您的帮助
I uploaded nopcommerce solution to appharbor (using this method Can't build notcommerce project under appharbor) and solution succesfully builded, but I receiving 403 error - Forbidden: Access is denied when trying to open page(Allow write-access to file system is set to true).
Thanks and hope for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问题是标准的 NopCommerce 解决方案包含两个 Web 项目。 AppHarbor 只为每个应用程序部署一个 Web 项目,在这种情况下,我们碰巧部署了
Nop.Admin
这不是您想要的。要解决此问题,您应该利用 AppHarbor解决方案文件约定并创建仅引用
Nop.Web
项目的AppHarbor.sln
解决方案文件。The problem is that the standard NopCommerce solution contains two Web Projects. AppHarbor only deploys one web project per application, and in this case, we happen to deploy
Nop.Admin
which is not what you want.To resolve this, you should take advantage of the AppHarbor solution file convention and create an
AppHarbor.sln
solution file that only references theNop.Web
project.我们在基本控制器中使用包装器来确保我们的所有代码都不会注意到 appharbor 端口的更改。
首先,修复 Webhelper.cs:75
所以我们所做的只是从 https://gist.github.com 添加文件/1158264 进入 Nop.Core\AppHarbor
并修改基本控制器:
nopcommerce\Presentation\Nop.Web\Controllers\BaseNopController.cs
nopcommerce\Presentation\Nop.Web.Admin\Controllers\BaseNopController.cs
We use a wrapper in our base controller to ensure that all of our code is oblivious to appharbor port changing.
First, fix in Webhelper.cs:75
So what we did is simply add files from https://gist.github.com/1158264 into Nop.Core\AppHarbor
and modified base controllers:
nopcommerce\Presentation\Nop.Web\Controllers\BaseNopController.cs
nopcommerce\Presentation\Nop.Web.Admin\Controllers\BaseNopController.cs
启用 IIS Express 中的目录浏览功能
注意 此方法适用于在使用 IIS Express 时遇到问题的 Web 开发人员。
为此,请按照下列步骤操作:
打开命令提示符,然后转到计算机上的 IIS Express 文件夹。例如,在命令提示符中转到以下文件夹:
C:\Program Files\IIS Express
键入以下命令,然后按 Enter:
appcmd set config /section:directoryBrowse /enabled:true
参考:https://support.microsoft. com/en-us/kb/942062
Enable the Directory Browsing feature in IIS Express
Note This method is for the web developers who experience the issue when they use IIS Express.
To do this, follow these steps:
Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt:
C:\Program Files\IIS Express
Type the following command, and then press Enter:
appcmd set config /section:directoryBrowse /enabled:true
refrence :https://support.microsoft.com/en-us/kb/942062