Implement support for Bin directory
authorMarek Habersack <grendel@twistedcode.net>
Wed, 21 Feb 2007 12:39:08 +0000 (12:39 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 21 Feb 2007 12:39:08 +0000 (12:39 -0000)
svn path=/trunk/mcs/; revision=73249

mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
mcs/class/System.Web/System.Web.Hosting/ChangeLog
mcs/class/System.Web/System.Web/ChangeLog
mcs/class/System.Web/System.Web/HttpApplicationFactory.cs
mcs/class/System.Web/System.Web/HttpRuntime.cs

index ab794dca3717b6d8f4768a1dc550c5f50d3ee2bc..0d44f164a3e36299a948e431b202f8c3e5996c87 100644 (file)
@@ -73,6 +73,15 @@ namespace System.Web.Hosting {
 #endif
                }
 
+               static string GetBinPath (string physicalDir)
+               {
+                       string ret = Path.Combine (physicalDir, "Bin");
+                       if (Directory.Exists (ret))
+                               return ret;
+                       ret = Path.Combine (physicalDir, "bin");
+                       return ret;
+               }
+               
                //
                // For further details see `Hosting the ASP.NET runtime'
                //
@@ -112,7 +121,7 @@ namespace System.Web.Hosting {
                        setup.ApplicationName = domain_id;
                        setup.ConfigurationFile = FindWebConfig (physicalDir);
                        setup.DisallowCodeDownload = true;
-                       string bin_path = Path.Combine (physicalDir, "bin");
+                       string bin_path = GetBinPath (physicalDir);
                        setup.PrivateBinPath = bin_path;
                        setup.PrivateBinPathProbe = "*";
                        setup.ShadowCopyFiles = "true";
index 342c0ec81786f5787e4dbb30d713aa82f5f206c5..fff1de2a0b09b012121918fe71ea3546a7ad1971 100644 (file)
@@ -1,3 +1,8 @@
+2007-02-21  Marek Habersack  <grendello@gmail.com>
+
+       * ApplicationHost.cs: support both Bin and bin directories, prefer
+       the former.
+
 2007-02-19  Marek Habersack  <grendello@gmail.com>
 
        * ApplicationHost.cs: Use a deterministic application name, so
index e6e2fd7fcfd3d49c4928264c68b0bf3e950bc5fb..88fa4a10477867ab7836fcc73417ebef071d7128 100644 (file)
@@ -1,3 +1,11 @@
+2007-02-21  Marek Habersack  <grendello@gmail.com>
+
+       * HttpRuntime.cs: BinDirectory returns the bin directory
+       determined by the application host on the application startup.
+
+       * HttpApplicationFactory.cs: Watch the bin directory determined by
+       the application host on the application startup.
+
 2007-02-20  Vladimir Krasnov  <vladimirk@mainsoft.com>
 
        * HttpRequest.cs: fixed MapPath, removed TARGET_J2EE block that checks
index 8e2113144168557275e9a50449bc6a8726985ff0..ae964f6962f2c7adb841080ab64d81b1c7f65802 100644 (file)
@@ -438,11 +438,12 @@ namespace System.Web {
                                factory.InitType (context);
                                lock (factory) {
                                        if (factory.app_start_needed) {
-                                               WatchLocationForRestart("bin", "*.dll");
+                                               WatchLocationForRestart (AppDomain.CurrentDomain.SetupInformation.PrivateBinPath,
+                                                                        "*.dll");
 #if NET_2_0
-                                               WatchLocationForRestart("App_Code", "");
-                                               WatchLocationForRestart("App_Browsers", "");
-                                               WatchLocationForRestart("App_GlobalResources", "");
+                                               WatchLocationForRestart ("App_Code", "");
+                                               WatchLocationForRestart ("App_Browsers", "");
+                                               WatchLocationForRestart ("App_GlobalResources", "");
 #endif
                                                app = factory.FireOnAppStart (context);
                                                factory.app_start_needed = false;
index c023606474ecaf9ec08e60fdbce971e6fbb4755b..b06f1289e304b0ef4c6c3ca4ba6d3a7d3d4c7a4f 100644 (file)
@@ -176,7 +176,7 @@ namespace System.Web {
                
                public static string BinDirectory {
                        get {
-                               string dirname = Path.Combine (AppDomainAppPath, "bin");
+                               string dirname = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
                                if (SecurityManager.SecurityEnabled) {
                                        new FileIOPermission (FileIOPermissionAccess.PathDiscovery, dirname).Demand ();
                                }