tags:

views:

45

answers:

2

I started a new solution (with multiple projects) and am trying to get it to build. Initially I was getting an internal compiler error and thought maybe it had to do with MySql, so I removed all references to MySql. Now I am getting the error "Could not find a 'Sub Main' in ''". I have made sure that all of my projects have a Main subroutine like this:

Public Shared Sub Main()
End Sub

2 out of the 7 projects will compile. I don't know what makes these projects different from the others, and the error message isn't very helpful. Any experience with this one?

+2  A: 

In VB.Net the Main method is almost always declared within a Module. This code does not look like it has the Main method in a Module as the Shared would cause a compilation error. Try putting it into a module and specifying the name of the module as the startup one to the compiler.

JaredPar
+1  A: 

I would suggest checking your Module also. I utilize modules frequently to tie multiple projects together. They use the sub Main in much the same way as a form would utilize the load event.

Michael Eakins