ASP.NET Session Lost When Use Web Garden Settings

2019-08-27 19:07发布

问题:

I have an ASP.NET MVC (.NETFramework 4.5) application, when I hosted (IIS-7.5), I set max Worker process to 5, And Set Session State to StateServer And Set a static machinekey, after all my session is null,

Why?

Is there any settings that I lost?

any suggestion?

回答1:

The problem that I found is so wired, when I use web-garden or web-farm the object that stored in session must be serializable but in regular we don't need this.

So I just add a serializable attribute above the object that stored in session and all things is OK!.