is inaccessible due to its protection level

Код тут : http :/ / pastebin. com/41rk70tp
Суть такая : есть класс MetrickPage.
В форме есть коллекция экземпляров этого класса (Pages)
В отдельном потоке нужно добавить экземпляр в эту коллекцию («тело» потока — в IndexThreadWorker, добавление и вывод вынес в метод ShowPageInfo)

I have three classes. all are part of the same namespace. here are the basics of the three classes.

I’m getting the following errors

‘StubGenerator.PropGenerator.Method’ is inaccessible due to its protection level

which refers to the following line in the FBlock.cs file

‘StubGenerator.PropGenerator.Method’ is inaccessible due to its protection level

which refers to the following line in the FBlock.cs file

Inconsistent accessibility: return type ‘StubGenerator.PropGenerator.Method’ is less accessible than method ‘StubGenerator.PropGenerator.FBlock.AddMethod(string)’

which refers to the following line in the FBlock.cs file

making the class Method public does not resolve the errors. I can’t figure out why I don’t get the errors when calling the Property class. And I don’t understand why making the Method class public doesn’t fix the problem.

Edited to ask. could there be some setting on the file that causes this?

«член» недоступен из-за его уровня защиты ‘member’ is inaccessible due to its protection level

Модификатор доступа для члена класса запрещает доступ к этому члену. The access modifier for a class member prevents accessing the member. Дополнительные сведения см. в статье Модификаторы доступа. For more information, see Access Modifiers.

Одна из причин этого (не показана в следующем примере) может быть связана с отсутствием флага компилятора /out для целевого объекта дружественной сборки. One cause of this (not shown in the sample below) can be omitting the /out compiler flag on the target of a friend assembly. См. сведения в разделах Дружественные сборки и -out (параметры компилятора C#). For more information, see Friend Assemblies and -out (C# Compiler Options).

Пример Example

В следующем примере возникает ошибка CS0122: The following sample generates CS0122:

Оцените статью