Skip to content

Extract method fails on top-level programs #56969

@timheuer

Description

@timheuer

Version Used:
Microsoft Visual Studio Enterprise 2022 Int Preview (64-bit)
Version 17.0.0 Preview 5.0 [31726.67.main]

Steps to Reproduce:

  1. Create new Console app, choose .NET 6
  2. Add some more code in the Program.cs file
  3. Highlight some code and choose Edit menu, Refactoring > Extract method (or use keyboard shortcut CTRL+R,CTRL+M)

Expected Behavior:
Extract method refactoring starts and highlighted code can be extracted into function within the top-level program file.

Actual Behavior:
image

Video:
extractontoplevel

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions