question

luigiraffaelesapone avatar image
0 Votes"
luigiraffaelesapone asked JiachenLiMFST-9349 answered

unable to set a form as startup object

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?


vs-generaldotnet-visual-basicvs-setup
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JiachenLiMFST-9349 avatar image
1 Vote"
JiachenLiMFST-9349 answered

Hi @luigiraffaelesapone ,
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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.