直到今天,我可以使用主要构造函数,例如:
public class Test(string text)
{
private string mText = text;
}
Run Code Online (Sandbox Code Playgroud)
为了能够做到这一点,在以前的Visual Studio CTP中,我不得不将其添加到csproj文件中:
<LangVersion>Experimental</LangVersion>
Run Code Online (Sandbox Code Playgroud)
无论如何,这不再适用于Visual Studio 2015预览版(有或没有LangVersion).有没有人对可能发生的事情有任何想法?