小编And*_*err的帖子

C# 8.0 - 不能使用默认接口实现

我最近读到有关 C# 8.0 具有接口默认实现的信息,所以我进入了我的项目并尝试了它,但我遇到了一个错误。Target runtime doesn't support default interface implementation. 有没有办法解决这个问题?

string CommandName { get => CommandName.ToUpperInvariant(); }
Run Code Online (Sandbox Code Playgroud)

编辑 我正在使用Console

c# interface default-implementation c#-8.0

8
推荐指数
1
解决办法
4877
查看次数

标签 统计

c# ×1

c#-8.0 ×1

default-implementation ×1

interface ×1