[英]netcoreapp3.1 appears to reference C# 7.3 and not 8 as documented
我已經將現有的 asp.net mvc 應用程序從 netcoreapp3.0 更新到 netcoreapp3.1,以及所有引用的包。 項目設置有目標框架,我的電腦安裝了 SDK
<TargetFramework>netcoreapp3.1</TargetFramework>
我在使用 C# coaslescing 分配功能的地方出錯了??=
這在更新之前沒有問題。 @SebastianHofmann 已經確認其他 C#8 功能也不起作用。
Error CS8370 Feature 'coalescing assignment' is not available in C# 7.3.
Please use language version 8.0 or greater.
根據 MSFT netcoreapp3.1 應該使用 C#8 並且確實必須
我剛剛看到的高級項目設置已在 Visual Studio 2019 (16.3.10) 中禁用
我可以切換回 3.0 並再次編譯
我已經將 ??= 添加到現有的 Core 3 項目並且沒有錯誤,然后使用最新補丁 (V 4.7.03062) 更新 VS 以獲得 3.1,然后將項目升級到 3.1 也沒有錯誤。 我能得到你的錯誤的唯一方法是將項目降級到 2.1。 是否值得在您的 VS 上運行修復/更新。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.