相关疑难解决方法(0)

'field'但用作'type'

我收到的错误消息似乎无法弄明白.我看到还有很多其他类似的问题,但解决方案似乎并不适合我.

错误信息:

'PaymentPlanStoreLogic.Class1.myLog' is a 'field' but is used like a 'type'
Run Code Online (Sandbox Code Playgroud)

我的代码:

using System;
using PaymentPlanLogic;
namespace PaymentPlanStoreLogic
{
  public class Class1
  {
    Logger myLog = new Logger();
    myLog.createLog();
   }
}
Run Code Online (Sandbox Code Playgroud)

对象浏览器:

public void createLog()
Member of PaymentPlanLogic.Logger
Run Code Online (Sandbox Code Playgroud)

我按照页面(对象)上的建议尝试了以下内容 是'字段'但是像'类型'一样使用

PaymentPlanLogic.Logger.createLog();
Run Code Online (Sandbox Code Playgroud)

但是我得到了错误

"'PaymentPlanLogic.Logger.createLog()' is a 'method' but is used like a 'type'"
Run Code Online (Sandbox Code Playgroud)

.net c#

9
推荐指数
2
解决办法
5万
查看次数

标签 统计

.net ×1

c# ×1