Expression bodied get / set accessors feature in c# 7.0

前端 未结 3 1533
难免孤独
难免孤独 2020-12-20 13:04

I\'m having this code in a class

private string test;
public string Test
{
    get =>  test;
    set => test = value;
}

But the compi

3条回答
  •  再見小時候
    2020-12-20 13:26

    I had the same problem. I have compared my project to another project that was OK and found this line from .csproj cause the problem.

    Simply remove it and it worked and don't know why.

提交回复
热议问题