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.上面是其中一段需要修改的地方。改了基本就正常了。觉得不爽。
  • 相关阅读:
    第二个冲刺
    实验四主存空间的分配和回收
    Sprint总结
    Sprint回顾
    Scrum项目5.0
    hibernate jpa 注解 @Temporal(TemporalType.DATE) 格式化时间日期,页面直接得到格式化类型的值
    获得HttpServletResponse及其他对象
    UUID.randomUUID()方法介绍
    psp个人软件过程需求文档
    电子产品自动搜索比价系统设计与实现 项目愿景与范围
  • 原文地址:https://www.cnblogs.com/Bruce_H21/p/226450.html
Copyright © 2011-2022 走看看