开发者

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

开发者 https://www.devze.com 2022-12-28 11:24 出处:网络
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 refere

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

精彩评论

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