This issue has been moved from a ticket on Developer Community.
Create new C# project (I targeted .NET 6)
This creates a new style project with no "class" or "namespace"
Delete content and paste in this:
static void X(string s)
{
s = s.Trim();
}
Select the "s = s.Trim();" line and Ctrl-. to refactor and choose Extract Method
You get a build error
Severity Code Description Project File Line Suppression State
Error CS8421 A static local function cannot contain a reference to 'NewMethod'. ConsoleApp32 C:\Users\danmose\source\repos\ConsoleApp32\ConsoleApp32\Program.cs 4 Active
Message IDE0062 Local function can be made static ConsoleApp32 C:\Users\danmose\source\repos\ConsoleApp32\ConsoleApp32\Program.cs 7 Active
It should make the new method static.
Original Comments
Feedback Bot on 11/28/2021, 10:07 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)
This issue has been moved from a ticket on Developer Community.
Create new C# project (I targeted .NET 6)
This creates a new style project with no "class" or "namespace"
Delete content and paste in this:
static void X(string s)
{
s = s.Trim();
}
Select the "s = s.Trim();" line and Ctrl-. to refactor and choose Extract Method
You get a build error
Severity Code Description Project File Line Suppression State
Error CS8421 A static local function cannot contain a reference to 'NewMethod'. ConsoleApp32 C:\Users\danmose\source\repos\ConsoleApp32\ConsoleApp32\Program.cs 4 Active
Message IDE0062 Local function can be made static ConsoleApp32 C:\Users\danmose\source\repos\ConsoleApp32\ConsoleApp32\Program.cs 7 Active
It should make the new method static.
Original Comments
Feedback Bot on 11/28/2021, 10:07 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)