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

Paebbels Paebbels at gmail.com
Mon Oct 27 16:55:27 EDT 2008



Rolf Bjarne Kvinge-2 wrote:
> 
> [...] 
> 
> It's not possible to remove the Microsoft.VisualBasic reference when
> compiling in VS 2008 [1].
> 
> In any case you don't have to, mono includes Microsoft.VisualBasic.dll,
> though it is not installed by default. The package you need to install is
> named 'mono-basic' in openSuse, I think it's called
> libmono-microsoft-visualbasic8.0-cil in Debian (according to this page at
> least: http://packages.debian.org/source/sid/mono-basic)
> 
>> is it posible to totally remove this "My" Namespace from VB-projects?
> 
> Yes. Define _MYTYPE=\"Empty\". Also see:
> http://msdn.microsoft.com/en-us/library/ms233781.aspx
> 
> Rolf
> 
> [1]. It is possible to remove the Microsoft.VisualBasic.dll reference when
> compiling from the command line, using passing '-vbruntime-' to the
> compiler. Also see: http://msdn.microsoft.com/en-us/library/bb531259.aspx
>  
> [...]
> 

thanks for your post and your links

now I wrote 2 scripts for Windows:

build.cmd:
----------
vbc @build.rsp
----------


build.rsp:
----------
# Compiler-Options
/target:exe
#/main:MainModule
/rootnamespace:LookupTableEditor
/out:pn-lte.exe
/noconfig
/nostdlib
/vbruntime-
/platform:anycpu
/optimize+
/optionexplicit+
/optioncompare:binary
/optioninfer+
#/verbose
/bugreport:bugreport.log
/define:_MYTYPE="Empty"

# References
/libpath:"C:\Windows\Microsoft.NET\Framework\v2.0.50727"
/reference:mscorlib.dll,System.dll,

# Files
*.vb
----------

now I have the same errors on windows, but with more details :)

bugreport.log
----------
[...]
### 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?

(C# needs this too *g*)


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).


** (../../class/lib/bootstrap/vbnc.exe:19307): WARNING **: Could not load
file o                                                                                                                              
r assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyTok                                                                                                                              
en=b77a5c561934e089' or one of its dependencies.

** (../../class/lib/bootstrap/vbnc.exe:19307): WARNING **: Could not load
file o                                                                                                                              
r assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyTok                                                                                                                              
en=b77a5c561934e089' or one of its dependencies.

** (../../class/lib/bootstrap/vbnc.exe:19307): WARNING **: Could not load
file o                                                                                                                              
r assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyTok                                                                                                                              
en=b77a5c561934e089' or one of its dependencies.
Error : VBNC99999: Unexpected error: Could not load file or assembly
'System.Win                                                                                                                              
dows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' o                                                                                                                              
r one of its dependencies.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000]
  at vbnc.TypeManager.LoadReferencedTypes () [0x00000]
  at vbnc.TypeManager.LoadReferenced () [0x00000]
  at vbnc.Compiler.Compile () [0x00000]
Compilation took 00:00:00.8375950
make[3]: *** [extract-source.exe] Error 255
make[3]: Leaving directory `/root/vbnc/mono-basic-2.0/tools/extract-source'
make[2]: *** [do-all] Error 2
make[2]: Leaving directory `/root/vbnc/mono-basic-2.0/tools/extract-source'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/vbnc/mono-basic-2.0/tools'
make: *** [all-recursive] Error 1
----------


If I see it right: make uses vbnc to build some files, but vbnc requires
some nonexisting files ?

-- 
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.



More information about the Mono-vb mailing list