[mono-vb] CLI program compiled with VS08 does't run under Mono 1.9.1

Rolf Bjarne Kvinge rolflists at ya.com
Tue Oct 28 05:32:31 EDT 2008


Hi,

> [...]
> ### Compiler output
> E:\EWMS\Studies\LookupTableEditor\CLIArgumentParser.vb(158) : error
BC35000:
> Requested operation is not available because the runtime library function
> 'Microsoft.VisualBasic.CompilerServices.Operators.CompareString' is not
> defined.
> 
>                 If value <> _UnSetValue Then
>                    ~~~~~~~~~~~~~~~~~~~~
> ### User description
> ### User suggested correct behavior
> ----------
> 
> I know that string comparisions are not as easy as integer
> comparisions, but why do they define an Compare Operator / Method in the
VisualBasic
> namespace their should be an Compare Operator in mscorlib.dll or
System.dll as
> well, shouldn't it?
> 

This is because VB doesn't compare strings like C#, VB has 'Option Compare
Text|Binary', and when doing string comparison the compiler inserts a
argument to that function informing about this. There is also a minor
difference when comparing Nothing and empty strings ("");

If "" = Nothing Then
	Console.WriteLine ("This prints in VB")
End If

If ("" == null)
	Console.WriteLine ("This won't print in C#");

You can replace the comparison with string.Equals, like this (to do binary
comparison, look at intellisense/msdn how get text comparison if that's what
you're using):

If string.Equals (value, _UnSetValue) Then
	...
End If

In any case it would be easier for you to get Microsoft.VisualBasic.dll
installed on your system :)

> 
> I have found "libmono-microsoft-visualbasic8.0-cil", but it's only for
> sid...
> Compiling from source shows some errors:
> 
> ----------
> ewms:~/vbnc/mono-basic-2.0# make
> make[1]: Entering directory `/root/vbnc/mono-basic-2.0/build'
> make all-local
> make[2]: Entering directory `/root/vbnc/mono-basic-2.0/build'
> make[2]: Leaving directory `/root/vbnc/mono-basic-2.0/build'
> make[1]: Leaving directory `/root/vbnc/mono-basic-2.0/build'
> make[1]: Entering directory `/root/vbnc/mono-basic-2.0/class'
> make all-local
> make[2]: Entering directory `/root/vbnc/mono-basic-2.0/class'
> make[2]: Leaving directory `/root/vbnc/mono-basic-2.0/class'
> make[1]: Leaving directory `/root/vbnc/mono-basic-2.0/class'
> make[1]: Entering directory `/root/vbnc/mono-basic-2.0/tools'
> make[2]: Entering directory `/root/vbnc/mono-basic-2.0/tools/extract-
> source'
> make all-local
> make[3]: Entering directory `/root/vbnc/mono-basic-2.0/tools/extract-
> source'
> MONO_PATH="../../class/lib/bootstrap:$MONO_PATH" mono  --debug
> ../../class/lib/
> bootstrap/vbnc.exe    -debug -r:System.Xml.dll -noconfig
> -define:_MYTYPE=\"Empty
> \" -target:exe -out:extract-source.exe   @extract-source.exe.sources
> Visual Basic.Net Compiler version 0.0.0.5904
> Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.
> 
> 
> 
> ** (../../class/lib/bootstrap/vbnc.exe:19307): WARNING **: The
> following
> assembl
> y referenced from
> /root/vbnc/mono-basic-2.0/class/lib/bootstrap/Microsoft.Visual
> Basic.dll could not be loaded:
>      Assembly:   System.Windows.Forms    (assemblyref_index=2)
>      Version:    2.0.0.0
>      Public Key: b77a5c561934e089
> The assembly was not found in the Global Assembly Cache, a path listed
> in
> the MO
> NO_PATH environment variable, or in the location of the executing
> assembly
> (/roo
> t/vbnc/mono-basic-2.0/class/lib/bootstrap).

Vbnc requires System.Windows.Forms.dll, which you apparently don't have
installed. I think this resides in the package named
'libmono-winforms2.0-cil' in debian.

Rolf 

> 
> --
> View this message in context: http://www.nabble.com/CLI-program-
> compiled-with-VS08-does%27t-run-under-Mono-1.9.1-
> tp20174907p20196231.html
> Sent from the Mono - VB mailing list archive at Nabble.com.
> 
> _______________________________________________
> 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