You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This error commonly occurs in Windows Forms applications when you attempt to define your own `Sub Main` procedure while the Visual Basic Application Framework is enabled. The application framework automatically generates a `Main` procedure, creating a conflict when you add another one.
20
+
This error often occurs in Windows Forms applications when you define your own `Sub Main` procedure while the Visual Basic Application Framework is enabled. The application framework automatically generates a `Main` procedure, creating a conflict when you add another one.
21
21
22
22
## To correct this error
23
23
24
24
Choose one of the following approaches:
25
25
26
26
### Option 1: Use the Application Framework (Recommended for most Windows Forms apps)
27
27
28
-
1. Remove your custom `Sub Main` procedure.
29
-
1. Configure your startup form and initialization code using the application framework:
30
-
- Set the **Startup form** in **Project Properties** > **Application** tab.
31
-
- Use the `My.MyApplication` events for custom startup logic.
28
+
- Remove your custom `Sub Main` procedure.
29
+
- Configure your startup form and initialization code using the application framework:
30
+
- Set the **Startup form** in **Project Properties** > **Application** tab.
31
+
- Use the `My.MyApplication` events for custom startup logic.
32
32
33
33
### Option 2: Disable the Application Framework
34
34
35
35
If you need programmatic control over application startup (for example, to select which form to display based on command-line arguments):
0 commit comments