I get an error message in VisualStudio that I can’t solve on my own. The message is:
Inconsistent accesibility: property type ‘WindowsFormApplication1.ContactFiles.Contact’ is less accessible than property ‘WindowsFormApplication1.ContactForm.ContactData’
public ContactFiles.Contact ContactData
{
get
{
return m_contact;
}
set
{
if (value != null)
m_contact = value;
}
}
Preciate help to find the error source for this problem! Thanks!
Kyle has suggested one approach, but if that’s causing more (similar) errors then you could try going the other way: make your property internal:
If you need the property to be public, then you’ll need
Contactto be public… which means you need to look at all the public properties ofContactto see whether they refer to internal (or private) types, etc.Basically you can’t have a public property returning an internal (or private nested) type – it would be effectively saying “You can use this, but you’re not allowed to know anything about what I’ll return” which doesn’t make sense. The same is true for parameters and return types of normal methods. You also can’t derive a public class from an internal one.