开发者

inconsistent accessibility error in C# interface implementation

开发者 https://www.devze.com 2023-03-28 11:39 出处:网络
At first, I have gone over similar questions already, but i still think my problem is something different.:)

At first, I have gone over similar questions already, but i still think my problem is something different.:)

I have an interface :

namespace TEDLibrary
{
    public interface ILogWriter
    {
        void WriteLog(ILogRecord log);
    }
}

and i have an implementation class :

namespace TEDLibrary
{
    public class LogWriter : ILogWriter
    {
        public LogWriter()
        { 

        }

        public void WriteLog(ILogRecord log)
        { 

        }
    }
}

As you see classes and members are public already.

However i get

Inconsistent accessibility: parameter type 'TEDLibrary.ILogRecord'开发者_开发百科 is less accessible than method 'TEDLibrary.ILogWriter.WriteLog(TEDLibrary.ILogRecord)'

I tried to declare WriteLog method in interface as public but it is not allowed.


ILogRecord should be public too.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号