2007-11-06 Igor Zelmanovich <igorz@mainsoft.com>
authorIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Tue, 6 Nov 2007 15:37:12 +0000 (15:37 -0000)
committerIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Tue, 6 Nov 2007 15:37:12 +0000 (15:37 -0000)
* AssemblyResourceLoader.cs:
makes it works for System.Web.Extensions.

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

mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs
mcs/class/System.Web/System.Web.Handlers/ChangeLog

index 80a854b2d3a412bab3a64e775488fc130c79d77f..55c00826c78c958731522609c3fbe1f2ca4e86af 100644 (file)
@@ -44,6 +44,7 @@ namespace System.Web.Handlers {
        partial class ScriptResourceHandler
        {
                const string HandlerFileName = "ScriptResource.axd";
+               static Assembly currAsm = typeof (ScriptResourceHandler).Assembly;
 #else
        #if NET_2_0
        public sealed
@@ -52,23 +53,23 @@ namespace System.Web.Handlers {
        #endif
        class AssemblyResourceLoader : IHttpHandler {           
                const string HandlerFileName = "WebResource.axd";
+               static Assembly currAsm = typeof (AssemblyResourceLoader).Assembly;
 #endif
                const char QueryParamSeparator = '&';
 
                static readonly Hashtable _embeddedResources;
 #if SYSTEM_WEB_EXTENSIONS
-       static ScriptResourceHandler()
+               static ScriptResourceHandler () {
+                       MachineKeySectionUtils.AutoGenKeys ();
 #else
-               static AssemblyResourceLoader()
+               static AssemblyResourceLoader() {
 #endif
-               {
                        _embeddedResources = new Hashtable ();
                        InitEmbeddedResourcesUrls ();
                }
 
                static void InitEmbeddedResourcesUrls ()
                {
-                       Assembly currAsm = typeof (AssemblyResourceLoader).Assembly;
                        WebResourceAttribute [] attrs = (WebResourceAttribute []) currAsm.GetCustomAttributes (typeof (WebResourceAttribute), false);
                        for (int i = 0; i < attrs.Length; i++) {
                                string resourceName = attrs [i].WebResource;
@@ -81,8 +82,8 @@ namespace System.Web.Handlers {
                {
                        string url = null;
                        Assembly assembly = type.Assembly;
-                       
-                       if (assembly == typeof (AssemblyResourceLoader).Assembly)
+
+                       if (assembly == currAsm)
                                url = (string) _embeddedResources [resourceName];
 
                        return (url != null) ? url : GetResourceUrl (assembly, resourceName, false);
@@ -163,7 +164,7 @@ namespace System.Web.Handlers {
                
                internal static string GetResourceUrl (Assembly assembly, string resourceName, bool notifyScriptLoaded)
                {
-                       string aname = assembly == typeof (AssemblyResourceLoader).Assembly ? "s" : assembly.GetName ().FullName;
+                       string aname = assembly == currAsm ? "s" : assembly.GetName ().FullName;
                        string apath = assembly.Location;
                        string atime = String.Empty;
                        string extra = String.Empty;
@@ -206,7 +207,7 @@ namespace System.Web.Handlers {
                                throw new HttpException (404, "No resource name given");
                        
                        if (asmName == null || asmName == "s")
-                               assembly = typeof (AssemblyResourceLoader).Assembly;
+                               assembly = currAsm;
                        else
                                assembly = Assembly.Load (asmName);
                        
index d4b139a6f62b9993a2cb7a234bab0abcd109ba42..83ccd34b91cb6f91d5883e7735995e7dbf0e6127 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-06 Igor Zelmanovich <igorz@mainsoft.com>
+
+       * AssemblyResourceLoader.cs:
+       makes it works for System.Web.Extensions.       
+
 2007-11-02 Juraj Skripsky  <js@hotfete.ch>
 
        * AssemblyResourceLoader.cs: As the assembly name is encrypted via