Help I'm getting this error:
Error 1 Inconsistent accessibility: parameter type 'SharpUpdate.SharpUpdateXml' is less accessible than method 'SharpUpdate.SharpUpdateInfoForm.SharpUpdateInfoForm(SharpUpdate.iSharpUpdateable, SharpUpdate.SharpUpdateXml)'
From this code:
namespace SharpUpdate
{
public class SharpUpdateInfoForm : Form
{
public SharpUpdateInfoForm(
iSharpUpdateable applicationInfo,
SharpUpdateXml updateInfo)
{
InitializeComponent();
if (applicationInfo.ApplicationIcon != null)
this.Icon = applicationInfo.ApplicationIcon;
this.Text = applicationInfo.ApplicationName + "- Update Info";
this.lblVersions.Text = String.Format(
"Current Version: {0}\nUpdate Version: {1}",
applicationInfo.ApplicationAssembly.GetName().Version.ToString(),
updateInfo.Version.ToString());
this.txtDescription.Text = updateInfo.Description;
}
}
}
I've tried changing public to internal and private, but the error remained the same.
Your error is fairly self-explanatory. It boils down to the following:
The
SharpUpdateInfoFormis of course the constructor of your form. The constructor is public and theSharpUpdateXmlclass passsed to the constructor is less accessible (either private or internal). You have to make theSharpUpdateXmlclass public orSharpUpdateInfoForminternal (or private ifSharpUpdateXmlis private).In current scenario you expose your
SharpUpdateInfoFormto everyone (public) but to initialize it you have to useSharpUpdateXmlwhich is not available to everyone (private/internal). So a user of your classes can try to initialize the form but may not be allowed to useSharpUpdateXmlwhich makes whole setup bit useless.