Bugzilla – Bug 317997
[PATCH] Class specified using /main option should be considered fully qualified
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by gert.driesen@pandora.be 2005-05-15 03:34:38 MST ---- The class that is specified using the /main option of mbas should always be considered to be fully qualified. Right now, mbas combines the rootnamespace and the specified class to obtain the fully qualified class name. This does not match the behaviour of vbc. From the .NET SDK: "A full qualification to the Sub Main procedure to be called when the program starts." The attached patch files this issue. To reproduce, compile the following code snippet: Public Class MyForm Inherits System.Windows.Forms.Form End Class using: mbas /target:winexe /main:MBasTest.MyForm /rootnamespace:MBasTest /r:Syste m.dll /r:System.Windows.Forms.dll MyForm.vb Actual result: error BC30737: Program xxx/MyForm.exe does not have an entry point defined Expected result: Compilation succeeds ---- Additional Comments From gert.driesen@pandora.be 2005-05-15 03:36:59 MST ---- Created an attachment (id=167945) Fix ---- Additional Comments From rafaelteixeirabr@hotmail.com 2005-05-16 18:32:57 MST ---- Fixed with some refactoring and one more constraint checked and reporting error (when the given name for the main class doesn't exist). ---- Additional Comments From gert.driesen@pandora.be 2007-04-18 09:39:18 MST ---- This one fails with vbnc. ---- Additional Comments From rolfkvinge@ya.com 2007-04-23 05:53:35 MST ---- Fixed in r76098. ---- Additional Comments From gert.driesen@pandora.be 2007-04-25 17:33:55 MST ---- When target is winexe, and a main class is not specified on the command line and no main method can be found, then an unexpected error is reported. To reproduce, compile the following code snippet (using vbnc /target:winexe Form1.vb): Public Class Form1 Inherits System.Windows.Forms.Form End Class Expected result: error BC30420: 'Sub Main' was not found in 'Form1'. Actual result: Property group resolution failed (unrecoverably), showing log Unexpected error: An error message should have been shown: 'Failed to resolve property group' at vbnc.Helper.AddError (System.String Message) [0x00000] at vbnc.PropertyGroupToPropertyAccessExpression.ResolveExpressionInternal (vbnc.ResolveInfo Info) [0x00000] at vbnc.Expression.ResolveExpression (vbnc.ResolveInfo ResolveInfo) [0x00000] at vbnc.Argument.ResolveCode (vbnc.ResolveInfo Info) [0x00000] at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection, vbnc.ResolveInfo Info) [0x00000] at vbnc.ArgumentList.ResolveCode (vbnc.ResolveInfo Info) [0x00000] at vbnc.InvocationOrIndexExpression.ResolveExpressionInternal (vbnc.ResolveInfo Info) [0x00000] at vbnc.Expression.ResolveExpression (vbnc.ResolveInfo ResolveInfo) [0x00000] at vbnc.CallStatement.ResolveStatement (vbnc.ResolveInfo Info) [0x00000] at vbnc.CodeBlock.ResolveCode (vbnc.ResolveInfo Info) [0x00000] at vbnc.MethodBaseDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000] at vbnc.MethodDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000] at vbnc.SubDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000] at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection, vbnc.ResolveInfo Info) [0x00000] at vbnc.BaseObjects`1[vbnc.IMember].ResolveCode (vbnc.ResolveInfo ) [0x00000] at vbnc.TypeDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000] at vbnc.ClassDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000] at vbnc.AssemblyDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000] at vbnc.Compiler.Compile_Resolve () [0x00000] at vbnc.Compiler.Compile () [0x00000] Compilation took 00:00:01.5349290 ---- Additional Comments From rolfkvinge@ya.com 2007-05-28 07:25:19 MST ---- This is fixed now (it wasn't a problem with Sub Main, but with the recently implemented My namespace). Imported an attachment (id=167945) Unknown operating system unknown. Setting to default OS "Other".