G
Guest
Hi everybody,
The C# compiler reports a Compiler Error CS0052 in the following situation:
I declared a type marked as "internal":
namespace MyNamespace
{
internal class MyInteralClass
{
// ...
}
/*
I tried to use this type in a public class, and I want it to be accessible
only for devired classes in the same assembly so I set its accessibility
level to protected internal.
*/
public class MyPublicClass
{
protected internal MyInteralClass MyField;
// ...
}
}
I tried to compile the source and the compiler reports the CS0052 error:
error CS0052: Inconsistent accessibility: field type
'MyNamespace.MyInteralClass' is less accessible than field
'MyNamespace.MyPublicClass.MyField'
Is it a bug? Cannot such consrtuction be used? I didn't find any details for
this situation in the MDSN Library.
Thanks a lot, best
Ãron Kolozs
The C# compiler reports a Compiler Error CS0052 in the following situation:
I declared a type marked as "internal":
namespace MyNamespace
{
internal class MyInteralClass
{
// ...
}
/*
I tried to use this type in a public class, and I want it to be accessible
only for devired classes in the same assembly so I set its accessibility
level to protected internal.
*/
public class MyPublicClass
{
protected internal MyInteralClass MyField;
// ...
}
}
I tried to compile the source and the compiler reports the CS0052 error:
error CS0052: Inconsistent accessibility: field type
'MyNamespace.MyInteralClass' is less accessible than field
'MyNamespace.MyPublicClass.MyField'
Is it a bug? Cannot such consrtuction be used? I didn't find any details for
this situation in the MDSN Library.
Thanks a lot, best
Ãron Kolozs