Code Completion not Working in VS2022 and .NET Core 6

Jeff Gaines 351 Reputation points
2023-07-04T11:44:35.4666667+00:00

I started my first Core 6 project for Windows in VS2022 this morning. I added a couple of buttons and a ListView to a form then hit F7 to add the code for the buttons and the button names weren't recognised so I couldn't add the code. Typing the Button name in manually didn't help either as the name still wasn't recognised.

I always add code like this as I use common names/functions and it makes it easy to move code between projects.

Is this functionality not available with Core 6 projects?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,400 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 30,816 Reputation points Microsoft Vendor
    2023-07-21T09:50:56.5266667+00:00

    Hi @Jeff Gaines

    Welcome to Microsoft Q&A! 

    Please right click on the Button control > Properties > find Design property > change the name to btntest.

    User's image

    Then, go to FormMain.cs and it displays normally.

    User's image

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.