当试图编译我的C#Windows应用程序我收到以下错误:“functionname”不存在当前上下文存在名称
The name 'GetActiveLB' does not exist in the current context
下面是调用该函数的代码:
using F5LTMMaintenance;
......
private void btnLBSetA_Click(object sender, EventArgs e)
{
List<string> range = GetActiveLB();
foreach (string item in range)
{
// Do something with item
}
}
然后,我有以下类:
namespace F5LTMMaintenance
{
public class F5LTM<T>
{
public List<T> GetActiveLB()
{
var client = new RestClient("mylb.domain.local");
var request = new RestRequest("mgmt/tm/cm/failover-status", Method.GET);
var queryResult = client.Execute<List<T>>(request).Data;
return queryResult == null ? new List<T>() : queryResult;
}
}
}
的GetActiveLB功能确实存在,它是一种公共福所以为什么我得到这个错误?任何帮助,将不胜感激。
谢谢 - 事后看来这是有道理的。我只是看不到它。非常感谢! – Brad
@Rahul好点,我的意思是指出,但忘了。 – weston