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

Rafael Teixeira monoman at gmail.com
Sun Oct 26 16:48:12 EDT 2008


The all VB.NET compilers use many other things from Microsoft.VisualBasic
assembly, it is the "runtime" library for the language, so you won't be able
to remove references to it. If you don't wan't such a dependency you should
use C# that AFAIK is the only language that doesn't need some other runtime
library besides the 3 core .NET assemblies (mscorlib, System and
System.Xml).

To have your program running in mono you just need to install the mono
package that contains the library and the compiler (the name depends on the
distro, as they package it differently, although most use the mono-basic
prefix).

Hope it helps,

On Sun, Oct 26, 2008 at 1:47 PM, Paebbels <Paebbels at gmail.com> wrote:

>
> Hello,
>
> I have written a CLI programm in VisualBasic with VisualStudio 2008.
>
> options and modifications to the standard VB-cli template:
> - destination framework version 2.0
> - removed unused dependencies
> - removed Microsoft.VisualBasic Namespace
> - commented all < ***VisualBasic ***> attributes
> - commented all source code related to the My-Namespace from code-generator
>
> then I compiled my project with VS und copied it with WinSCP to Linux:
> - Debian
> - Mono 1.9.1 with libmono-microsoft8.0-cil
>
> Error when starting $ mono ./LookupTableEditor.exe -i
>
> ----------
> ** (./LookupTableEditor.exe:13487): WARNING **: The following assembly
> referenced from /root/ewms/lte/LookupTableEditor.exe could not be loaded:
>     Assembly:   Microsoft.VisualBasic    (assemblyref_index=1)
>     Version:    8.0.0.0
>     Public Key: b03f5f7f11d50a3a
> The assembly was not found in the Global Assembly Cache, a path listed in
> the MONO_PATH environment variable, or in the location of the executing
> assembly (/root/ewms/lte/).
>
> ** (./LookupTableEditor.exe:13487): WARNING **: Could not load file or
> assembly 'Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
>
> ** (./LookupTableEditor.exe:13487): WARNING **: Missing method
> ConditionalCompareObjectNotEqual in assembly
> /root/ewms/lte/LookupTableEditor.exe, type
> Microsoft.VisualBasic.CompilerServices.Operators
>
> Unhandled Exception: System.IO.FileNotFoundException: Could not load file
> or
> assembly 'Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
> File name: 'Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a'
> ----------
>
> i know that mono is searching for Microsoft.VisualBasic but I removed every
> dependency I could find :(
>
> monodis ./LookupTableEditor.exe has this output:
>
> ----------
> .assembly extern mscorlib
> {
>  .ver 2:0:0:0
>  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
> }
> .assembly extern Microsoft.VisualBasic
> {
>  .ver 8:0:0:0
>  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
> }
>
> [...]
> .namespace LookupTableEditor.My
> {
>  .class private auto ansi MyApplication
>        extends
>
> [Microsoft.VisualBasic]Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase
>  {
>    .custom instance void class
> [System]System.ComponentModel.EditorBrowsableAttribute::'.ctor'(valuetype
> [System]System.ComponentModel.EditorBrowsableState) =  (01 00 01 00 00 00
> 00
> 00 ) // ........
>
>    .custom instance void class
> [System]System.CodeDom.Compiler.GeneratedCodeAttribute::'.ctor'(string,
> string) =  (
>                01 00 0A 4D 79 54 65 6D 70 6C 61 74 65 07 38 2E   //
> ...MyTemplate.8.
>                30 2E 30 2E 30 00 00                            ) // 0.0.0.
> .
> [...]
> ----------
>
>
>
> is it posible to totally remove this "My" Namespace from VB-projects?
> --
> View this message in context:
> http://www.nabble.com/CLI-program-compiled-with-VS08-does%27t-run-under-Mono-1.9.1-tp20174907p20174907.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
>



-- 
Rafael "Monoman" Teixeira
---------------------------------------
"I myself am made entirely of flaws, stitched together with good
intentions."
Augusten Burroughs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-vb/attachments/20081026/9528d8f9/attachment.html 


More information about the Mono-vb mailing list