user3484554
user3484554

Reputation: 11

Inconsistent accessibility error: field less accessible than field

I've tried to solve this problem that I have but I really don't know what else to do. I get this error: Inconsistent accessibility: field type 'ChatClient.Configurator.IPChangeHandler' is less accessible than field 'ChatClient.Configurator.IPChange'

and this is part of the code:

namespace ChatClient
{
    public partial class Configurator : Form
    {
        public delegate void IPChangeHandler(object sender, IPAddressInfoEventArgs e);
        public event IPChangeHandler IPChange;
        // ...
    }
}

making delegate and class public did not worked out. Thank you!

Upvotes: 1

Views: 855

Answers (2)

Chirag Suthar
Chirag Suthar

Reputation: 21

Please Go to Solution Part ..& Open the IPAddressInfoEventArgs.cs file ....

Update in that File....

using System;
using System.Collections.Generic;
using System.Text;

namespace ChatClient
{
    public class IPAddressInfoEventArgs : EventArgs
    {
       private string _ipAddress;
       public IPAddressInfoEventArgs(string ipAddress)
        {
            this._ipAddress = ipAddress;
        }

        public string IPAddress
        {
            get { return this._ipAddress; }
        }
    }
}

Upvotes: 0

brewerof
brewerof

Reputation: 102

Check accessible level of IPAddressInfoEventArgs class.

It must be public since the event IPChange is public too.

Upvotes: 1

Related Questions