Extract Method not running on VStudio2022

1.1k Views Asked by At

do you have any idea why the extrac method is not working on VStudio2022.

Example: be selecting following code, and if I go to EDIT->Refractor->Extract Method error appears like in the screenshoot.

No valid selection to perform extaction

var stack = new SimpleStack();
stack.Push(1.2);
stack.Push(2.8);
stack.Push(3.0);

double sum = 0.0;

while(stack.Count > 0)
{
    double item = stack.Pop();
    Console.WriteLine($"Item: {item}");
    sum += item;
}

Console.WriteLine($"Sum: {sum}");

Console.ReadLine();
0

There are 0 best solutions below