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

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

    This also happens on a raw web site project where there was no web.config generated.

    Although the solution file said 3.5, .Net needed the web.config to state it also to recognize. I ran debug allowing it to create a webconfig, and all was working.

    So it is like the answer provided, but just make sure you have one.

提交回复
热议问题