In version 1.1 of Visual Studio .NET, when you added a module and a Sub Main, the Project Property Dialog would automatically pick up that fact and add it to the Startup Object Dropdown list. Not so in VS2005...well, not that simply. VS2005 assumes that the Startup Object will be Form1. When you remove the form, you will get errors. To clear the problem, do the following.
1. Open the Project Property Dialog.
2. Click the Application Tab if not already selected.
3. Uncheck the Enable application framework check box.
You should now see Sub Main listed in the Startup Object Dropdown List.
When you generate a Windows Application, it automatically creates a main form (Form1). If you do not want your application to have a UI, you probably want to remove the Form from the project and replace it with a Module. Removing the Form1.vb from the project will cause you to have errors in the application. Of course you could create a Console application, but generally I have no use for them and they still popup a command window, which is a form of UI, which I am trying to prevent by removing the Form1 to begin with.