gpt4 book ai didi

c# - VSCode 错误 :. ..已经包含了...的定义|以下方法或属性之间的调用不明确,

转载 作者:行者123 更新时间:2023-11-30 13:18:49 25 4
gpt4 key购买 nike

我在 VSCode -> GNU/Linux 中遇到这些错误:

  • 命名空间“”已经包含了一个定义'GCoreT' [testc]

对于这种行为,我已经阅读过,

How to fix "namespace x already contains a definition for x" error? Happened after converting to VS2010

但我找不到适合我的解决方案。


  • 以下方法或属性之间的调用不明确:'GCoreT.mapTex(string, E[])' 和 'GCoreT.mapTex(string, E[])' [testc]

  • 类型“GCoreT”已经定义了一个名为“mapTex”的成员参数类型 [testc] void GCoreT.mapTex(string text, E[] add)

.

我认为这是最相关的简化代码。

using System;

namespace testc
{
class Program
{
static void Main(string[] args)
{
//..

}
}
}

using System;

class GCoreT{
^^^------------------> he says 0


public Ene[] GTEne (String tex, E[] ene){
//..
mapTex(tex, ene);
^^^------------------> he says 1
//..
}

private void mapTex(String text, E[] add){
^^^------------------------------> he says 2
//..
}
}

VSCode 说:

0

The namespace '' already contains a definition for 'GCoreT' [testc]

1

The call is ambiguous between the following methods or properties: 'GCoreT.mapTex(string, E[])' and 'GCoreT.mapTex(string, E[])' [testc]

2

Type 'GCoreT' already defines a member called 'mapTex' with the same parameter types [testc] void GCoreT.mapTex(string text, E[] add)


最佳答案

重新启动 Omnisharp 对我有用。按 CTRL + SHIFT + P,然后从列表中选择“重新启动 Omnisharp”

关于c# - VSCode 错误 :. ..已经包含了...的定义|以下方法或属性之间的调用不明确,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43236862/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com