zoukankan      html  css  js  c++  java
  • 看了二十四画生的文章才发现ASP.NET Portal Starter Kit中调整顺序的一个Bug

    public void SaveSiteSettings() 

        
    // 原来的:从Cache中获取站点设置信息数据集(好像是个Bug,因为每次更新数据是更新的HttpContext.Current.Items中的) 
        
    //SiteConfiguration siteSettings = (SiteConfiguration) HttpContext.Current.Cache["SiteSettings"]; 
        
    // 修改后的 
        SiteConfiguration siteSettings = (SiteConfiguration) HttpContext.Current.Items["SiteSettings"]; 
     
        
    // 如果Cache中没有,则重新构建 
        if(siteSettings == null
        

            
    // If SaveSiteSettings() is called once, the cache is cleared.  If it is 
            
    // then called again before Global.Application_BeginRequest is called,  
            
    // which reloads the cache, the siteSettings object will be Null  
            
    // (这一句不知翻译的对不对,好像很重要)如果SaveSiteSettings()被调用过一次后,Cache就回被清除。如果它再一次被调用在Global.Application_BeginRequest前siteSettings为null则重新写Cache 
            siteSettings = GetSiteSettings(); 
        }
     
        
    string configFile = HttpContext.Current.Server.MapPath(ConfigurationSettings.AppSettings["configFile"]); 
     
        
    // Object is evicted from the Cache here.   
        
    // 将变更后的数据集写入到Xml文件 
        siteSettings.WriteXml(configFile); 
    }
     

    说起来挺气人的,微软放了这么久的东西这么明显一个bug都不改过来。前几个星期抽了时间把portal排序的主要的一些代码提出来看看,编译后执行程序,要么点了后不动,要么就是ModuleOrder的顺序重复,还以为是自己的问题,放了几个星期了,今天偶然回来博客园看看,发现二十四花生的一篇文章http://www.cnblogs.com/esshs/archive/2005/04/18/139829.html提及到这个Bug.上面是其中一段需要修改的地方。改了基本就正常了。觉得不爽。
  • 相关阅读:
    实例
    LR接口测试---webservices
    LR常用函数整理
    Codeforces Round #639 (Div. 2) A. Puzzle Pieces
    Codeforces Round #640 (Div. 4)全部七题
    POJ3177 Redundant Paths(e-DCC+缩点)
    洛谷P3469 [POI2008]BLO-Blockade(割点)
    洛谷P3275 [SCOI2011]糖果(缩点+拓扑序DP)
    POJ1236 Network of Schools(强连通分量)
    P3387 【模板】缩点(Tarjan求强连通分量)
  • 原文地址:https://www.cnblogs.com/Bruce_H21/p/226450.html
Copyright © 2011-2022 走看看