尝试在具有 2018 年 4 月更新的 W10 机器上的 VS 2017 中分析我的命令行应用程序,VS 无法创建报告。
用户界面说Microsoft Visual Studio was unable to create a diagnostics report. Check Output window for errors。
输出窗口说
Profiling of 'Program' started.
Program has exited.
Profiling of 'Program' stopped.
Diagnostics session stopped with errors.
Merging of ETL files has failed (0x80070070) (Flags: 0x0000011f).
Run Code Online (Sandbox Code Playgroud) 我有一些类具有多个属性,这些属性具有明确定义的名称和功能,但具有相同的实现.例如:
class Stats
{
private int attack;
public int Attack
{
get =>
HasBuff ? attack + 1 : attack;
set
{
if (value < 1 || value > 10)
throw new ArgumentOutOfRangeException("Invalid value");
attack = value;
}
}
public int Defense {...}
public int Speed {...}
}
Run Code Online (Sandbox Code Playgroud)
在哪里Defense和Speed将要实施就像Attack.如何概括此结构以避免冗余并使更改更容易?