|inconsistent accessibility c#||0.72||0.2||4360||8|
|inconsistent accessibility c||0.91||0.5||7099||27|
|inconsistent accessibility c# list||0.62||0.7||4363||64|
|inconsistent accessibility c# error||1.86||0.4||6274||26|
|inconsistent accessibility c# cs0051||0.39||0.5||2379||66|
|inconsistent accessibility c# interface||1.11||0.6||5045||87|
|inconsistent accessibility c# constructor||1.73||0.1||7370||74|
|inconsistent accessibility c# base class||1.62||0.6||5558||38|
|inconsistent accessibility c# return type||0.76||0.8||7059||30|
|inconsistent accessibility c# parameter type||0.42||0.2||6052||18|
CS0051 – Inconsistent accessibility: parameter type ‘type’ is less accessible than method ‘method’ Reason for the Error You would receive this error when you are passing an object as a parameter and the type that is being passed has a private/internal access modifier. For example, try compiling the below code snippet.How to make a class publicly accessible?
1 By default (leaving out the accessibility keyword) a class is internal and not publicly accessible. It's best to explicitly declare the accessibility of the class to show intent. – Tim Smit Feb 25 at 21:03What is the default accessibility of FILEINFO class?
Your Fileinfo class does not have any accessibility defined ; so its default accessibility is set to internal. That means that this class is usable only from the library (or the executable) that defines it. You cannot use this class from a foreign assembly.What happens if I leave the accessibility label out of Assembly?
If you leave out the accessibility label, it defaults to internal, that is, only accessible to other classes within the assembly. Share Follow edited Feb 7 '09 at 23:09