IIS 7.5中的会话/LDAP问题.原因 [英] Session/LDAP issues in IIS 7.5.Reason

查看:48
本文介绍了IIS 7.5中的会话/LDAP问题.原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用IIS 7.5承载asp.net 4.0应用程序.该应用程序使用LDAP和Session变量等.

该应用程序在本地开发环境中运行时可以正常工作.但是在IIS中托管时无法运行,这意味着Session变量具有如下代码

如果(Session ["groupsList"]!= null)
{
groupsList =(ArrayList)Session ["groupsList"];
}

在VS 2010的开发环境中运行时,它可以正常工作并在数组列表中获得"ADMIN"作为值.

但是在IIS 7.5中托管时,Session ["groupsList"]为null.

请让我知道这个问题的解决方案,方法是深入研究3天.

LDAP是否存在问题?或者是否需要更改任何web.config

I am using IIS 7.5 To host asp.net 4.0 application. the application uses LDAP and Session variables etc.

The application works fine when run in the local dev environment.But not working while hosted in IIS which means the Session variable has code like this

if (Session["groupsList"] != null)
{
groupsList = (ArrayList)Session["groupsList"];
}

which works fine and gets "ADMIN" as value in array list when run in development environment in VS 2010.

But the Session["groupsList"] is null when hosted in IIS 7.5.

Please could you let me know a solution for this as digging into this for 3 days.

Is there a problem with LDAP?Or is that any web.config needs to be changed

推荐答案

,它可以正常工作并在数组中获取"ADMIN"作为值在VS 2010中的开发环境中运行时列出该列表.但是在IIS 7.5中托管时,Session ["groupsList"]为空.
如果发现存储在会话中,则上述代码所做的所有工作就是分配分组列表.就是这样!

现在,如果它在您的IIS上不起作用,则上述几行表示该会话为空,您应该检查该会话是否完全被填充?检查填充位置,并确保在需要时进行.会话字段将不会提供任何值,直到您填写为止.顺便说一句,由于它是会话,所以它将在每个会话的基础上在访问您网站的每位新用户中发生.如果这对于每个人来说都是常见且固定的,那么您应该使用Application变量并将其加载到Global.asax中,以便在首次访问该应用程序时填充它.

最后,如果您仍然感到困惑,则可以使用远程调试器与托管环境配合使用,并查看步骤如何进行.
which works fine and gets "ADMIN" as value in array list when run in development environment in VS 2010.But the Session["groupsList"] is null when hosted in IIS 7.5.
All what above code does is assign the groupslist if it is found stored in Session. Thats it!

Now, if it is not working on your IIS, above lines mean that the session is null and you should check if the session was even populated at all? Check the place where this is populated and make sure it is happening when needed. Session field will not provide any value until it is filled by you. BTW, since it is session, it will happen on every new user who access your website - per session basis. If this is something common and fixed for everyone, then you should use Application variable and load it up in Global.asax such that it is populated when the application is accessed for the first time.

Lastly, if you are still confused then use remote debugger to tie up with hosted environment and see how steps are happening.


这篇关于IIS 7.5中的会话/LDAP问题.原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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