Share via

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?

Developer technologies | Visual Studio | Setup
Developer technologies | VB
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.


Answer accepted by question author
  1. Jiachen Li-MSFT 34,241 Reputation points Microsoft External Staff
    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 additional answers

Sort by: Most helpful

Your answer

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