开发者

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

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开发者_StackOverflow 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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜