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

后端 未结 9 1386
离开以前
离开以前 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:38

    Your code is valid - it should work fine. Go in to the property pages of your project and make sure that the "Target Framework" is .NET 3.0 or 3.5.

提交回复
热议问题