zoukankan      html  css  js  c++  java
  • 关于“Ambiguous match found”

         将博客园程序升级到ASP.NET 2.0之后,打开分类页面,出现错误:
         Parser Error 
         Description: An error occurred during the parsing of a resource required to service this request. Please review the     following specific parse error details and modify your source file appropriately.
    Parser Error Message: Ambiguous match found.
         Source Error: 
         Line 1:  <%@ Control Language="c#" Inherits="Dottext.Web.UI.Controls.EntryList" %>
         Line 2:  <%@ Import Namespace = "Dottext.Framework" %>
         Line 3:  <h2><asp:Literal ID = "EntryCollectionTitle" Runat = "server" /></h2>
                
         博客园的程序是通过VS 2005 Web Application Project编译的,EntryList是一个用户控件。
         而之前我直接将ASP.NET 1.1版的博客园程序运行于ASP.NET 2.0时,也遇到过这个问题
         后来发现问题竟然是EntryList.ascx.cs中变量名在不区分大小写时重名引起的。
         引起问题的两个变量名是:    

    protected System.Web.UI.WebControls.Repeater Entries;
    private ArrayList entries;

         这两个变量名大小写不同,从语法上说应该是不同的变量名,所以编译时没问题,不知为什么运行时会出现问题?真是奇怪。我也没找出问题的具体原因,要想找出原因需要对ASP.NET 2.0中页面动态编译的代码进行仔细的研究。
         解决方法很简单,只要将其中一个变量改名就行了。

  • 相关阅读:
    Centos7安装gitlab私服
    SpringBoot2.x开发WebSocket
    java中 DecimalFormat格式的定义
    Docker部署Reids实战单机、集群
    CCF地铁修建
    C题:A Water Problem(dp||搜索)
    A题:Common Substrings(KMP应用)
    HDU 1879 继续畅通工程(Prim||Kruscal模板题)
    魔兽世界之一:备战(模拟)
    F题:等差区间(RMQ||线段树)
  • 原文地址:https://www.cnblogs.com/dudu/p/354023.html
Copyright © 2011-2022 走看看