【发布时间】:2020-05-09 23:23:03
【问题描述】:
我正在学习使用 .Net Core 3.1 学习 c# 版本 8 的新功能的教程
我正在使用最新版本的 Visual Studio 2019。 在玩一些练习时,我喜欢在下一个代码中出现错误
主题:目标类型的新表达式
Dictionary<string, List<int>> field = new Dictionary<string, List<int>>();
Dictionary<string, List<int>> field = new(); //this throws the error "requires (), [], or {} after type requires (), [], or {} after type"
我错过了什么吗? 我也尝试添加到项目中
<LangVersion>8.0</LangVersion>
有什么想法吗?
【问题讨论】:
标签: c# .net-core .net-core-3.1 c#-8.0