zoukankan      html  css  js  c++  java
  • Ambiguous match found in web application

    Today, we met a problem: everything is ok after I convert vs2003 to vs2008 except when execute a one page, the error is : Ambiguous match found. and runTime parser indicates this error occurs at <@ <%@ Page language="c#" Codebehind=....%>. Build process is ok, not any error occurs. After find help from internet, there is saying:

    It seems like you have two variables in your page that differ only in the
    case. For example, in your aspx page, you might have

    <asp:TextBox ID="UserID" runat="server"/>

    and in the code behind file you might have

    private Int32 userID = 0;

    Note that in my example, even though the variables have different
    accessiblity and types, the variable names are similar (the difference is
    only in the case).

    In my opinion, this is a bug - C# is case sensitive and the above code is
    perfectly legal from the point of view of the C# compiler. This explains why
    it works as intended from within the VS 2005 IDE. The aspnet_compiler too
    does not report any errors when you try to compile you website. However, some
    error in the reflection mechanism causes a case insensitive search and that
    is the reason for this "Ambiguous match found." error.

     

    from the source code review, yes, it is, there is LinkButton1 and Linkbutton1 2 varibles declaration. after remove one, everyting is OK.


  • 相关阅读:
    个人项目实战
    准备
    结队项目-第一次作业
    第三次作业--团队展示
    软件工程实践第二次作业
    软件工程实践第一次作业
    circle
    calculator
    视频课程学习及学习计划
    1001.A+B Format (20)
  • 原文地址:https://www.cnblogs.com/sdikerdong/p/1749023.html
Copyright © 2011-2022 走看看