How to force an IIS hosted WCF or ASMX [webservice] to use session object readonly?

前端 未结 3 1298
星月不相逢
星月不相逢 2020-12-18 04:22

While making my first ajax attempts, I decided also, to go to use IIS hosted WCF now. The strange thing is, that the WCF cannot process several requests parallel for the sam

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-18 04:27

    In .NET 4, you can do this in Application_BeginRequest

    if (Context.Request.Path.EndsWith("xxx.svc"))
       Context.SetSessionStateBehavior(SessionStateBehavior.ReadOnly);
    

提交回复
热议问题