编译器错误 CS0104
“reference”是“identifier”和“identifier”之间的不明确引用
程序包含两个命名空间的 使用 指令,而代码引用了在两个命名空间中都出现的名称。
以下示例生成 CS0104:
// CS0104.cs
using x;
using y;
namespace x
{
public class Test
{
}
}
namespace y
{
public class Test
{
}
}
public class a
{
public static void Main()
{
Test test = new Test(); // CS0104, is Test in x or y namespace?
// try the following line instead
// y.Test test = new y.Test();
}
}
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈