你 设置session 可用了吗

解决方案 »

  1.   

    我补充一下:
    1、EnableSessionState默认的是不需要再web.config中设置的。我没有modify这个文件过
    2、上面一共有4个StackTrace的信息,大家应该看最后一个,而不是最上面的一个。
    3、上述代码是IL之后的,不是我写的这个样子。
    4、不知道是不是late-bound的问题?
      

  2.   

    in Web.config
    Locate the <sessionState> section, and set the mode value to ON .
      

  3.   

    Exception Details: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive。
    try:
    enable sessionState in web.config.
    enable sessionState in  sub page.load
    enableSessionState=true
      

  4.   

    各位!exception是从里向外throw的,所以,请看最下面的exception message,而不是最上面的一个。
      

  5.   

    修改machine.config<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="1"/>
      

  6.   

    上面的错误是全部的了,ajex,machine.config修改哪个地方?
      

  7.   

    我的机器原来有这种问题.有一次我打开一个VB的工程.关掉后.再新建一个C#的工程.就出现了这种情况.我记得错误页的最下面有一个链接告诉你错误是如何发生的.以及如何解决.
    <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="1"/>
    核对一下,看你的有哪些区别.
      

  8.   

    没有任何区别!我想,不是machine.config的错误,因为我300多个页面中,只有两个有这个错误。而且,debug/release在ide下都没有任何问题,如果到integration server上运行,就有错了。
      

  9.   

    注意你的有没有warningLevel="1".
      

  10.   

    to ajex,我的和你的是完全一样的
      

  11.   

    你的出错消息上有没有什么链接.
    很有用的.HttpException (0x80004005).我查过了好像没有.继续关注.
      

  12.   

    部署时是部署到IIS服务器的子目录?
    如果是部署到子目录必须将该子目录设为Application才能正常地使用Session和进程Session状态管理。
      

  13.   

    这里的一切都是正常的,当然是application了,否则我们的程序就没法登录了至于hresult是0x80004005的错误,google上可以搜索到很多,不过,没有我这种症状的。
    ms的人说,需要memory dump,然后debug