不能访问外类型的非静态成员“Project.Neuro”经由 嵌套类型“Project.Neuro.Net '
与这样的代码(简化):
class Neuro
{
public class Net
{
public void SomeMethod()
{
int x = OtherMethod(); // error is here
}
}
public int OtherMethod() // its outside Neuro.Net class
{
return 123;
}
}
我可以移动问题的方法Neuro.Net类,但我需要以外这种方法。
我是一种客观的编程新手。
在此先感谢。
似乎很明显 - 'OtherMethod'是另一种类型的成员。它嵌套的事实并不意味着这些方法是_inherited_。 – 2013-05-01 15:19:06
看到这个答案的更多信息:http://stackoverflow.com/a/5393472/1451531 – Splendor 2013-05-01 15:21:31