2007-10-15 Juraj Skripsky <js@hotfeet.ch>
authorJuraj Skripsky <js@hotfeet.ch>
Mon, 15 Oct 2007 12:48:57 +0000 (12:48 -0000)
committerJuraj Skripsky <js@hotfeet.ch>
Mon, 15 Oct 2007 12:48:57 +0000 (12:48 -0000)
* SessionStateModule.cs (Init): Use HttpApplication.LoadType,
don't swallow TypeLoadException.

svn path=/trunk/mcs/; revision=87504

mcs/class/System.Web/System.Web.SessionState_2.0/ChangeLog
mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateModule.cs

index 4adac5b6a653e1b536fa2f6a72fe1ebcfe455591..47d647fe78f66fe5d1531752f4be8e8bb0cdb9b9 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-15  Juraj Skripsky  <js@hotfeet.ch>
+
+       * SessionStateModule.cs (Init): Use HttpApplication.LoadType,
+       don't swallow TypeLoadException.
+
 2007-10-15  Marek Habersack  <mhabersack@novell.com>
 
        * SessionStateServerHandler.cs: adjust order of field
index 2444085cfb681ca10b460493ac76ec5a604bbb4f..ce5cb734ed8349b99925a77fa87470c6bff13c45 100644 (file)
@@ -137,18 +137,16 @@ namespace System.Web.SessionState
 
                        handler = (SessionStateStoreProviderBase) ProvidersHelper.InstantiateProvider (settings, typeof (SessionStateStoreProviderBase));
 
-                       try {
-                               Type idManagerType;
-                               try {
-                                       idManagerType = Type.GetType (config.SessionIDManagerType, true);
-                               }
-                               catch {
-                                       idManagerType = typeof (SessionIDManager);
-                               }
-                               idManager = Activator.CreateInstance (idManagerType) as ISessionIDManager;
-                               idManager.Initialize ();
+                       if (String.IsNullOrEmpty(config.SessionIDManagerType)) {
+                               idManager = new SessionIDManager ();
+                       } else {
+                               Type idManagerType = HttpApplication.LoadType (config.SessionIDManagerType, true);
+                               idManager = (ISessionIDManager)Activator.CreateInstance (idManagerType);
                        }
-                       catch (Exception ex) {
+
+                       try {                           
+                               idManager.Initialize ();
+                       } catch (Exception ex) {
                                throw new HttpException ("Failed to initialize session ID manager.", ex);
                        }