[mono-vb] Simple VB app generate Error BC0000

A Rafael D Teixeira rafael.teixeirabr at terra.com.br
Wed Nov 2 08:39:24 EST 2005


HI Kevin thanks for spotting this:

I've commited a patch for the error to be less drastic and hiding the
real cause:

2005-11-02  Rafael Teixeira <rafaelteixeirabr at hotmail.com>
        * typemanager.cs: avoiding some Null Pointer Exceptions in
GetPertinentStandardModules

==================================
Would you like to continue (Y)es/(N)o/(E)dit Message:  y
Comitting...
Sending        mbas/ChangeLog
Sending        mbas/typemanager.cs
Transmitting file data ..
Committed revision 52474.


The problem is that mbas is not finding Microsoft.VisualBasic.dll to
automatically reference. mbas looks for it in the same directory
mbas.exe is.

To reproduce your problem I've run this way in directory mbas (sources)
after my latest patch:

mono --debug mbas.exe /t:exe /out:editor-mono.exe editor.vb
MonoBASIC Compiler  0.96.2.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira
--------
THIS IS AN ALPHA SOFTWARE.
--------
error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.LongType.FromString' could not
be found in 'Editor'
error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.IntegerType.FromString' could
not be found in 'Editor'
error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.SingleType.FromString' could not
be found in 'Editor'
error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.LongType.FromString' could not
be found in 'Editor'
error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.IntegerType.FromString' could
not be found in 'Editor'
error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.DoubleType.FromString' could not
be found in 'Editor'
error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.DecimalType.FromString' could
not be found in 'Editor'
error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.CharArrayType.FromString' could
not be found in 'Editor'error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.CharType.FromString' could not
be found in 'Editor'
error BC30451: The name
'Microsoft.VisualBasic.CompilerServices.BooleanType.FromString' could
not be found in 'Editor'
Compilation failed: 10 Error(s), 0 warnings

What pinpoints that MS.VB.DLL not being found is the real problem, to
make it sure I've tried referencing it explicitly:

mono --debug mbas.exe /t:exe /out:editor-mono.exe editor.vb -
r:../class/lib/default/Microsoft.VisualBasic.dll
MonoBASIC Compiler  0.96.2.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira
--------
THIS IS AN ALPHA SOFTWARE.
--------

** (mbas.exe:7475): WARNING **: Symbol
file /home/rafael/source/cli/mcs/class/lib/default/Microsoft.VisualBasic.dll.mdb has incorrect version (expected 39, got 38)
Compilation succeeded

It worked as expected (don't bother with that warning for now).

So make sure you've installed all things correctly: MS.VB.DLL MUST be in
the same as mbas.exe and Mono.GetOptions.dll, all the three non-core
parts of mbas.

Regards,


On Tue, 2005-11-01 at 18:45 -0800, Kevin Thompson wrote:
> i ran:
> 
> mbas /t:exe /out:editor-mono.exe editor.vb 
> 
> ===============editor.vb=====================
> Imports System
> 
> Public Class Editor
>     Public Shared Sub Main()
>       System.Console.WriteLine("Test App1")
>     End Sub
> End Class
> 
> ==========================================
> 
> 
> I get compilation error:
> 
> MonoBASIC Compiler  0.96.2.0 - (c)2002, 2003, 2004, 2005 Rafael
> Teixeira
> --------
> THIS IS AN ALPHA SOFTWARE.
> --------
> error BC0000: Exception: System.NullReferenceException: Object
> reference not set to an instance of an object
> in <0x00138> Mono.MonoBASIC.TypeManager:GetPertinentStandardModules
> (System.String[] namespaces)
> in <0x0045a> Mono.MonoBASIC.SimpleName:SimpleNameResolve
> (Mono.MonoBASIC.EmitContext ec, Mono.MonoBASIC.Expression right_side,
> Boolean allow_static)
> in <0x00011> Mono.MonoBASIC.SimpleName:DoResolveAllowStatic
> (Mono.MonoBASIC.EmitContext ec)
> in <0x0015b> Mono.MonoBASIC.Expression:Resolve
> (Mono.MonoBASIC.EmitContext ec, ResolveFlags flags)
> in <0x00092> Mono.MonoBASIC.MemberAccess:DoResolve
> (Mono.MonoBASIC.EmitContext ec, Mono.MonoBASIC.Expression right_side,
> ResolveFlags flags)
> in <0x00011> Mono.MonoBASIC.MemberAccess:DoResolve
> (Mono.MonoBASIC.EmitContext ec)
> in <0x0016b> Mono.MonoBASIC.Expression:Resolve
> (Mono.MonoBASIC.EmitContext ec, ResolveFlags flags)
> in <0x00092> Mono.MonoBASIC.MemberAccess:DoResolve
> (Mono.MonoBASIC.EmitContext ec, Mono.MonoBASIC.Expression right_side,
> ResolveFlags flags)
> in <0x00011> Mono.MonoBASIC.MemberAccess:DoResolve
> (Mono.MonoBASIC.EmitContext ec)
> in <0x0016b> Mono.MonoBASIC.Expression:Resolve
> (Mono.MonoBASIC.EmitContext ec, ResolveFlags flags)
> in <0x0019f> Mono.MonoBASIC.Invocation:DoResolve
> (Mono.MonoBASIC.EmitContext ec)
> in <0x0016b> Mono.MonoBASIC.Expression:Resolve
> (Mono.MonoBASIC.EmitContext ec, ResolveFlags flags)
> in <0x0000f> Mono.MonoBASIC.Expression:Resolve
> (Mono.MonoBASIC.EmitContext ec)
> in <0x0001d> Mono.MonoBASIC.StatementExpression:Resolve
> (Mono.MonoBASIC.EmitContext ec)
> in <0x001ad> Mono.MonoBASIC.Block:Resolve (Mono.MonoBASIC.EmitContext
> ec)
> in <0x000c1> Mono.MonoBASIC.EmitContext:EmitTopBlock
> (Mono.MonoBASIC.Block block, System.String bname,
> Mono.MonoBASIC.InternalParameters ip, Location loc)
> in <0x00465> Mono.MonoBASIC.MethodData:Emit
> (Mono.MonoBASIC.TypeContainer parent, Mono.MonoBASIC.Block block,
> System.Object kind)
> in <0x0002e> Mono.MonoBASIC.Method:Emit (Mono.MonoBASIC.TypeContainer
> parent)
> in <0x00239> Mono.MonoBASIC.TypeContainer:Emit ()
> in <0x00303> Mono.MonoBASIC.RootContext:EmitCode ()
> in <0x0001d> Mono.Languages.Driver:EmitCode ()
> in (wrapper delegate-invoke) System.MulticastDelegate:invoke_bool ()
> in <0x000df> Mono.Languages.Driver:Execute (System.String[] args)
> 
> 
> 
> Same thing compiles fine under .net 1.1
> 
> 
> 
> Am I doing something wrong?
>  
> 
> 
> -- 
> Kevin 
> 
> 
> ______________________________________________________________________
> E-mail classificado pelo Identificador de Spam Inteligente.
> Para alterar a categoria classificada, visite o Terra Mail 
> 
> 
> ______________________________________________________________________
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 01/11/2005 / Versão:
> 4.4.00/4617
> Proteja o seu e-mail Terra: http://mail.terra.com.br/ 
> 
> _______________________________________________
> Mono-vb mailing list
> Mono-vb at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-vb



More information about the Mono-vb mailing list