943,718 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 14524
  • C# RSS
Aug 8th, 2008
0

'Inconsistent accessibility' with multiple classes

Expand Post »
C# Syntax (Toggle Plain Text)
  1. Error 2 Inconsistent accessibility: parameter type 'SmartBackup.SmartBackupClass' is less accessible than method 'SmartBackup.BackupConfigurationForm.SmartBackupLoad(SmartBackup.SmartBackupClass)' C:\Documents and Settings\Mantas\My Documents\Visual Studio 2008\Projects\SmartBackup\SmartBackup\BackupConfigurationForm.cs 19 21 SmartBackup

Hi all, I was just wondering what the above error message means in laymans terms?
It relates to this code:

C# Syntax (Toggle Plain Text)
  1. namespace SmartBackup
  2. {
  3. public partial class BackupConfigurationForm : Form
  4. {
  5. private SmartBackupClass smartBackup;
  6. public BackupConfigurationForm()
  7. {
  8. InitializeComponent();
  9. }
  10. public void SmartBackupLoad(SmartBackupClass smartBackupLoaded)
  11. {
  12. this.smartBackup = smartBackupLoaded;
  13. }
  14. private void BackupConfigurationForm_Load(object sender, EventArgs e)
  15. {
  16.  
  17. }
  18. }
  19. }
'SmartBackupClass' is a class, it has a reference to BackupConfigurationForm

C# Syntax (Toggle Plain Text)
  1. private BackupConfigurationForm backupConfigurationForm;

backupConfigurationForm is created with the function:

C# Syntax (Toggle Plain Text)
  1. public void BackupConfigurationButton()
  2. {
  3. this.backupConfigurationForm = new BackupConfigurationForm();
  4. this.backupConfigurationForm.Show();
  5. this.backupConfigurationForm.LoadSmartBackup(this);
  6. }
Reputation Points: 10
Solved Threads: 0
Newbie Poster
LithMaster is offline Offline
1 posts
since Aug 2008
Aug 11th, 2008
0

Re: 'Inconsistent accessibility' with multiple classes

This is a problem with your use of public, protected, and private. Probably somewhere in your inheritance chain. Most likely forgot to add public infront of a class declaration somewhere.
Last edited by nvmobius; Aug 11th, 2008 at 8:36 pm.
Reputation Points: 11
Solved Threads: 4
Light Poster
nvmobius is offline Offline
39 posts
since Jul 2008
Oct 9th, 2010
0
Re: 'Inconsistent accessibility' with multiple classes
thank you very much, its hours tryin to figure that out. thanks a lot
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xolisamthobeli is offline Offline
1 posts
since Oct 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: How to write to access database
Next Thread in C# Forum Timeline: Read data from XML file to a Label





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC