Mono - Could not find 'Sub Main' in ''

I started a new solution (with several projects) and am trying to put it together. I was initially getting an internal compiler error and thought it was related to MySql, so I removed all references to MySql. Now I get the error "Could not find" Sub Main "in" ". I made sure all my projects have a main routine:

Public Shared Sub Main()
End Sub

      

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

+2


a source to share


2 answers


In VB.Net, a method is Main

almost always declared internally Module

. This code is not like the method Main

in Module

, as it Shared

will result in a compilation error. Try putting it in a module and specifying the module name as the starting point for the compiler.



+2


a source


I would suggest checking your module. I often use modules to combine multiple projects. They use sub Main in much the same way a form uses the load event.



+1


a source