Can we share session between ASP.NET 2.0 and ASP.NET 4.0 applications?
Can we sh开发者_C百科are session data between ASP.NET 2.0 and ASP.NET 4.0 applications? Is it possible if the types of the objects in the session are compatible?
I need to load an ASP.NET 4 application in Iframe on ASP.NET 2 application. The session data will be in a ASPNET Session Server or SQL server, or in AppFabric if it could be used in ASP.NET 2.0.
Using AppFabric is a good aproach.
You need to use the same session provider (there is a new provider in .Net 4 with AppFabric 1.1)
All session object must be Serializable (required by Out Of Process Session State Provider)
One other problem that may occurs is when accessing an unknow type (internal class in one of your website) : a TypeLoadException a thrown. The best option is to have a separate ClassLib that wraps Session.
精彩评论