IE11下的DNN 5加载错误(NullReferenceException)

时间:2013-12-16 18:56:39

标签: dotnetnuke dotnetnuke-5

我被要求使用DNN5.0创建的旧版网站

仅在使用IE11时存在问题。在以前的版本中,一切正常,以及使用其他浏览器(Chrome,Firefox)时。

我设法发现这是由从IE发送到服务器的用户代理引起的。当它设置为默认IE11值(User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko DNN生成错误时,当我使用开发人员工具将其更改为IE10时,一个(User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0))网站加载没有任何问题。将网站添加到兼容性视图列表也有帮助 - 它也在更改用户代理:User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)

当使用默认IE11用户代理标头服务请求到IE10用户代理行为时,是否可以更改DNN行为?我还没有搜索任何有趣的东西。

错误详情:

  

InnerException:未将对象引用设置为对象的实例。

     

方法:DotNetNuke.UI.WebControls.MenuNodeWriter.Render

     

StackTrace:

     

消息:DotNetNuke.Services.Exceptions.PageLoadException:Object   引用未设置为对象的实例。 --->   System.NullReferenceException:未将对象引用设置为实例   一个对象。在   DotNetNuke.UI.WebControls.MenuNodeWriter.Render(HtmlTextWriter writer)   在DotNetNuke.UI.WebControls.MenuNodeWriter.RenderNode(HtmlTextWriter)   编者,MenuNode节点)   DotNetNuke.UI.WebControls.MenuNode.Render(HtmlTextWriter writer)at at   DotNetNuke.UI.WebControls.DNNMenuWriter.RenderChildren(HtmlTextWriter的   作家)   DotNetNuke.UI.WebControls.DNNMenuWriter.RenderContents(HtmlTextWriter的   编写者)在System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter   编写者)在System.Web.UI.Control.RenderControlInternal(HtmlTextWriter   编写者,ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)at   DotNetNuke.UI.WebControls.DNNMenuWriter.RenderMenu(HtmlTextWriter的   作家,DNNMenu菜单)   DotNetNuke.UI.WebControls.DNNMenu.Render(HtmlTextWriter编剧)   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)at   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,   ICollection孩子们)   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)at   System.Web.UI.Control.Render(HtmlTextWriter writer)at   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)at   ASP.portals__default_skins_minimalextropy_index_ascx ._ 渲染 _control1(HtmlTextWriter的   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,__ w,Control parameterContainer)   ICollection孩子们)   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)at   System.Web.UI.Control.Render(HtmlTextWriter writer)at   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)at   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,   ICollection孩子们)   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)at   System.Web.UI.Control.Render(HtmlTextWriter writer)at   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)at   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,   ICollection孩子们)   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)at   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter的   作家)   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter的   编写者)在System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter   输出)在System.Web.UI.Control.RenderControlInternal(HtmlTextWriter   编写者,ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter的   编写者)在System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter   作家,ICollection孩子们)   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)at   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter的   编写者)在System.Web.UI.Control.RenderControlInternal(HtmlTextWriter   编写者,ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)at   ASP.default_aspx ._ 渲染 _control1(HtmlTextWriter __w,Control   parameterContainer)at   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,   ICollection孩子们)   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)at   System.Web.UI.Page.Render(HtmlTextWriter writer)at   DotNetNuke.Framework.PageBase.Render(HtmlTextWriter编剧)在   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer,   ControlAdapter适配器)   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)at   System.Web.UI.Page.ProcessRequestMain(布尔   includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)   ---内部异常堆栈跟踪结束---

2 个答案:

答案 0 :(得分:2)

我遇到了同样的问题,并且您在识别用户代理字符串时是正确的。

将browserCaps部分添加到您的web.config以修补它。我使用了以下内容:

  <system.web>
    <browserCaps>
      <!-- IE 11 Patch //-->
      <case match="Trident\/7.0; rv:(?'version'(?'major'\d+)(\.(?'minor'\d+)?)(?'letters'\w*))(?'extra'[^)]*)">
        browser=IE
        layoutEngine=Trident
        layoutEngineVersion=0${layoutVersion}
        frames=true
        tables=true
        cookies=true
        javascript=true
        javaapplets=true
        ecmascriptversion=1.5
        w3cdomversion=1.0
        css1=true
        css2=true
        xml=true
        tagwriter=System.Web.UI.HtmlTextWriter
        screenBitDepth=8
        isColor=true
        extra=${extra}
        letters=${letters}
        <case match="rv:(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*))">
          version=${version}
          majorversion=0${major}
          minorversion=0${minor}
          type=IE${major}
        </case>
      </case>
    </browserCaps>

答案 1 :(得分:0)

可能是这样的: http://www.hanselman.com/blog/IE10AndIE11AndWindows81AndDoPostBack.aspx

我建议您遵循DNN中的文档升级路径并升级到更新版本,看看您的问题是否消失。

http://www.dnnsoftware.com/wiki/page/suggested_upgrade_path

显然已经完成了所有工作并在开发/暂存环境中执行此操作。