Inconsistent accessibility???  
Author Message
Tryin2Bgood





PostPosted: Visual C# Language, Inconsistent accessibility??? Top

I have a CustomerContacts class and I create

private Tracking.BusinessObjects.CustomerContacts _ContactsOfCustomer = Tracking.BusinessObjects.CustomerContacts.NewContacts(2);

Then i make a public property and i get this error for some reason that i dont know

Error 3 Inconsistent accessibility: property type 'Tracking.BusinessObjects.CustomerContacts' is less accessible than property 'Tracking.BusinessObjects.Customers.ContactsOfCustomer' C:\Freight Enterprise Tracking Database\EntepriseFreight\ClassLibrary1\Customers.cs 135 68 BusinessObjects

Any reason to why i am getting this error

public BHFreight.Tracking.BusinessObjects.CustomerContacts ContactsOfCustomer

{

get

{

return _ContactsOfCustomer;

}

set

{

if (_ContactsOfCustomer != value)

{

_ContactsOfCustomer = value;

_IsDirty = true;

}

}

}




Visual C#12  
 
 
Brendan Grant





PostPosted: Visual C# Language, Inconsistent accessibility??? Top

Your type Tracking.BusinessObjects.CustomerContacts ... what is it's accessibility currently set to private or protected I'd wager.

If that is the case, the reason for the error is because while users of that property might be able to call it, the type it returns is one they do not have access to or knowledge of.



 
 
Tryin2Bgood





PostPosted: Visual C# Language, Inconsistent accessibility??? Top

U were right I am new too 2.0 and forgot that they dont display the access modifier for the cope when the initial class is declared and since all classes are private by default i had to set mine to public and happiness arrived once again...Thanks!~