给定一个函数
public static void foo(string bar, int baz) {
}
当这样调用时,Visual Studio 将显示错误The best overloaded method match for Foo(string,int) has some invalid arguments:
string bar;
string baz;
foo(bar, baz);
在这个例子中,解决方案很简单,baz
应该是一个int
。
但是我如何找出哪些参数无效呢?
最佳答案
在这种情况下,visual studio 将按以下顺序在 Error List
中显示该错误
Error 1 Cannot implicitly convert type 'Type A' to 'TypeB' SourceFIle.Cs Line Column Project
如果未启用错误 View 子窗口,请通过从“ View ”菜单激活来启用它
View -> Error List
希望对你有帮助
关于c# - 收到 'The best overloaded match for (...) has some invalid arguments' 时如何找出哪个参数无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27719115/