.NET property generating “must declare a body because it is not marked abstract or extern” compilation error

后端 未结 9 1427
离开以前
离开以前 2021-02-13 20:03

I have a .NET 3.5 (target framework) web application. I have some code that looks like this:

public string LogPath { get; private set; }
public string ErrorMsg          


        
9条回答
  •  面向向阳花
    2021-02-13 20:31

    It is, as long as you put abstract in front, or implement the methods.

    public abstract string LogPath { get; private set; }
    public abstract string ErrorMsg { get; private set; }
    

    See http://forums.asp.net/t/1031651.aspx

提交回复
热议问题