Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inconsistent accessibility: parameter type 'x' is less accessible than method 'y'

public partial class buyer : Form
{

   Client AbClient;
    public buyer(Client cli)
    {
        InitializeComponent();

        AbClient = cli;
    }

The function in which is throwing up the error.

public class Client {
}

Client is the class where the problem seems to be.

private void CheckAuth()
    {
        while (true)
        {
            if (!sAuth.IsAlive)
            {
                if(abClient.isAuthSucessful)
                    Application.Run(new buyer(abClient));
                break;  
            } 
        }
    }

This is where the Autobuyer form is called from. (Inside the first form which is started by the main())

I still don't know how to fix this, I've of course searched but no one seems to have the answer that works in my situation.

like image 639
Aidan Avatar asked Sep 07 '14 04:09

Aidan


1 Answers

I think your AbClient needs to be declared as public, as at the moment it's private by default. See MSDN - "The return type and parameter types of a method must be at least as accessible as the method itself."

like image 128
Christopher Dean Avatar answered Nov 15 '22 04:11

Christopher Dean