I'm a newb to .net framework (version 2002) and I bought the academic version along with the textbook that supposedly teaches it. Right off the bat - the very first most basic program (2 lines of code) will not work. I googled the error and M$ says it's a known bug and gives steps to correct it.. However, part of the steps to take are not within my program. This is in VB (btw) and I am told to go into the project/properties and common area. I am them to click the "General" tab and I don't have a general tab or button or anything else "general" The error is: "Sub main not found in 'welcome1.module1' This is because part of the lesson is to rename "Module1" to "Welcome1". Leaving it at "Module1" will work but I want to know why (if possible) the way the text book shows doesn't work and how do I fix it? Sorry for the long post.. I'm 62 years old and I tend to blather. Thanks!
Basically, the Sub called Main is a method within the module called Module1. These are created by the template when you start a new project. When the program executes it needs to know which bit of code to execute first, its entry point if you will. For any code outside of the Module1 to call Main, it needs to fully qualify it as such: Module1.Main.
If you change the name of the module to Welcome1, you need to update the setting on the General section of properties you mentioned to reflect this, to let it know the entry point is different ie: Welcome1.Main. Because this isn't being updated, that is why it works when you rename back to Module1.
I've got v2003 here, but I think it's the same route as described here: On the Project menu at the top, select ConsoleApplication1 Properties (if you called your project something else, then ConsoleApplication1 will be replaced with whatever you called it). On the dialogue that appears, there should be two combo boxes, one called Output type and one called Startup object. If you click on Startup object, the name of your module should appear, whether it is called Module1 or Welcome1. By selecting it and clicking OK, you should update this setting.
Thanks for the reply Mark - but in my 2002 version, all that is listed in the Projects Menu is this: Add Windows Form... Add Inherited Form... Add User Control... Add Inherited Control... Add Component... Add Module... Add Class... ------------------ Add New Item... Add Exsisting Item... ------------------ Exclude Project... Show All Files... ------------------ Add Reference Add Web Reference Set As Startup Project
This last item doesn't make any difference. Clicking it and then rebuilding causes the same error. Thanks for the reply anyway. Looks like I got stuck with a turkey - this 2002 version.
I currently have VS2K5 installed, and I can change the startup forum by going to the Solution Explorer and selecting Properties from the WindowsApplication1's right-click menu. Somewhere in that dialog should be an option for the Startup form.
If that doesn't work, you could always try a newer version.
Thanks for the imput! I stumbled upon the solution when clicking and peeking everywhere I could find. The solution for VB2000 is to right-click the name "Welcome1" in the "Solution Explorer" window and select "Properties" and in there is the "General" setting that's needed. *whew* I was really getting the mumbles! Tom
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE