简体   繁体   English

没有歧义时,vb.net中的“是歧义”错误消息

[英]“is ambiguous” Error message in vb.net when nothing is ambiguous

We have asp.net vb.net application which gives us random error situations. 我们有asp.net vb.net应用程序,它为我们提供了随机错误情况。

we are getting error messages like this: 我们收到这样的错误消息:

   Exception message: D:\xxxxxx\xxxxxx\artikkelit\bootstrapbartikkeli.aspx.vb(14): error BC30554: 'masterit_bootstrapb' is ambiguous.

<%@ Page Language="VB" Debug="false" AutoEventWireup="false" CodeFile="bootstrapbartikkeli.aspx.vb" Inherits="bootstrapbartikkeli" MasterPageFile="/masterit/bootstrapB.master" %>

Problem is that there is no double refrence to masterit_bootstrapb. 问题是对masterit_bootstrapb没有双重参考。 class name is unique on site. 类名在网站上是唯一的。 Most of times this error occurs when we modify master or nested master. 在大多数情况下,当我们修改母版或嵌套母版时,会发生此错误。 We can resolve this error by re-saving master and application vb-file. 我们可以通过重新保存主文件和应用程序vb文件来解决此错误。 Sometimes it requires many re-savings to get it work. 有时,它需要大量节省才能使其正常运行。 It seems like re compiling code in right order makes some magic to this...? 似乎以正确的顺序重新编译代码对此有些神奇……?

Same application and master is working fine on our test site thought. 在我们的测试站点上,相同的应用程序和master可以正常工作。

How could we see the actual source of this "is ambiguous" error message? 我们如何才能看到此“模棱两可”错误消息的实际来源? Is there any way we could trace deeper into this? 我们有什么办法可以更深入地了解这一点? This one application is making these erros thought we have many other applications that have this same master file on without ambigious erros. 这个应用程序使这些错误成为可能,以为我们还有许多其他应用程序具有相同的主文件而没有歧义的错误。

Is it possible that our test site could cause this error message to our production site? 我们的测试站点是否可能导致此错误消息到达我们的生产站点? Both sites are on same server, but on diffrent application pools. 两个站点都在同一台服务器上,但是在不同的应用程序池上。

Its namespace ambugity, you could have easily added a class and specifed the namespace in the class that is used assembly-wide rather than the class being a part of that assembly namespace. 它的名称空间含糊不清,您可以轻松地添加一个类并在该类中指定该名称空间,该类在整个程序集范围内使用,而不是将该类作为该程序集名称空间的一部分。

Its entirely possible one of the sites has a different reference leading to the above. 它完全有可能成为其中一个站点,因此引用了不同的参考文献。

Edit: 编辑:

You could do a search on masterit_bootstrapb and check the project doesn't have any classes that define it at a class level. 您可以在masterit_bootstrapb上进行搜索,并检查该项目是否没有在类级别定义该项目的类。 Unfortunately Visual Studio (or other tools) are not good at detecting these ambiguous errors.. 不幸的是,Visual Studio(或其他工具)不能很好地检测这些模棱两可的错误。

http://msdn.microsoft.com/en-us/library/8f0k13d2.aspx http://msdn.microsoft.com/en-us/library/8f0k13d2.aspx

You have provided a name that is ambiguous and therefore conflicts with another name. 您提供的名称不明确,因此与另一个名称冲突。 The Visual Basic compiler does not have any conflict resolution rules; Visual Basic编译器没有任何冲突解决规则。 you must disambiguate names yourself. 您必须消除自己的名字歧义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM