asp.net - NopContext.Current.User 始终为 null

标签 asp.net iis-6 32bit-64bit nopcommerce windows-server-2003-r2

注:also posted on the nopCommerce forum .


我一直在开发一个基于 nopCommerce 1.60 的应用程序。我正在 Windows 7 Pro 64 位上进行开发。

我正在将应用程序部署到 Windows Server 2003 R2(32 位)进行暂存,效果很好。它运行完美,与我在 Visual Studio 开发服务器上运行它时一模一样。

我刚刚将代码部署到实时服务器,以便在该环境中进行测试,并且我得到了一个真正的精彩。 NopContext.Current.User 始终为 null!

实时服务器是 Windows 2003 R2 64 位,这是我能看到的唯一区别。我已经检查了两台服务器上 IIS 中站点设置的每个页面,并确保每个设置都相同,我还对应用程序池执行了相同的操作。

我不知道我还能尝试什么。

有什么建议吗?

最佳答案

问题是 web.config 中缺少 anonymousIdentification 部分。

修复方法只是将以下内容添加到 system.web 部分

 <anonymousIdentification
      enabled="true" />

关于asp.net - NopContext.Current.User 始终为 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4090592/

相关文章:

asp.net - ASP.Net 中的 session 超时设置

networking - netsh mbn show interfaces 导致在 Win7 64Bit 上找不到命令

c# - 如何利用 IIS 应用程序池中的空闲 CPU 时间?

c# - 如何通过ASP.net运行EXE文件?

c# - 插入带有 where 子句的语句 c#

asp.net - Entity Framework 中与联结表的多对多关系?

c# - 如何设置使用 .NET Web 应用程序的子文件夹作为其基础的 IIS 网站?

c++ - 如何将内存地址存储为整数?

c - 为什么 C 中的 double 是 8 字节对齐的?

asp.net - 将 html 字符串转换为 ASP.Net 中的服务器控件