unable to set a form as startup object

Luigi Raffaele Sapone 21 Reputation points
2022-06-23T00:37:55.25+00:00

Previously I had the 2019 and 2022 versions of VS community on my pc. After uninstalling the 2019 version, and opening my projects in the 2022 version, I was asked to update to the 4.8 framework. Ok, I set 4.7.2, done.
But the project does not start because the only possible choice in the Project Property / Startup Object is “Sub Main”. But I don’t have a Sub Main. My Startup Object in all my project was a Form01 when I worked in VS 2019.

214019-immagine-2022-06-23-004904.png
If I change the “Enable framework application” checkbox, vs2022 prompts “start object must be a Form with Enable framework application option selected".
213977-immagine-2022-06-23-005320.png
But I can’t set a Form as start object, given that the only option in startup object textbox is Sub Main.
Any advice?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,647 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,581 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
971 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 26,751 Reputation points Microsoft Vendor
    2022-06-23T01:31:31.123+00:00

    Hi @Luigi Raffaele Sapone ,
    In Visual Studio 2022 when using VB.NET, WinForms, and .NET Framework, this might be a bug.
    The problem is under investigation.
    Can't select startup object in VB.net - VS 2022
    As a temporary solution, you can open the solution in VS 2019, set the Startup form, save, close VS 2019, and then re-open the solution in VS 2022.
    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful