[Mono-list] Language Clarification

B Anirban banirban@novell.com
Wed, 13 Oct 2004 00:14:34 -0600

Hey Devid,
As Rafael has already mentioned, if you specify "Page Language= VB" in
your aspx page VBCodeGenerator generates a corresponding VB file for
that page. This page gets compiled on the fly when you try to access
your asp .net application for the first time (even when you use
precompiled code behind). 

But unfortunately, the mbas is still way slow than mcs.
So, xsp gets time out by the time mbas finish compilation of the
generated VB file and hence you get the "thread terminated" exception in
the command prompt (in my machine xsp shows a time out message in

That was the reason I requested you change the page language to c#.

So, for the time being the only option we have is, try to keep as much
code as possible in code behind and use only c# as aspx page language.

Please keep an eye on mbas development. It will certainly come up to a
speed within next few months when will be able to use VB as page
language too.


>>> A Rafael D Teixeira <rafael.teixeirabr@terra.com.br> 12-Oct-04
11:20:23 PM >>>
Hi David,

There is two things you should know that affect your case:

1) as mentioned, Microsoft.VisualBasic is referenced for basically ANY
VB.NET solution, because without it you would not be able to use
language features like VB Modules or late-binding (Option Strict Off),
also useful things like Mid(), IsNumeric(), all reside in that
assemblies, whose implementation is halfway in Mono (we cover 100% of
the API, but throw many NotImplementedExceptions currently). 

Generally speaking C# is the only .NET language whose the whole
support it needs is just what the .NET base class library offers.
needs Microsoft.VisualBasic.dll, JScript.NET needs
Microsoft.JScript.dll, VisualC.NET needs Microsoft.VisualC.dll, Boo
needs Boo.dll, Nemerle needs Nemerle.dll, and so on.

2) ASP.NET pages are compiled on the fly (codebehind is compiled and
copied by VS.NET, but pages are left to be compiled by the ASP.NET
infrastructure). This demands that *CodeProvider/*CodeCompiler
of classes, one pair for each supported language, be available. Well
VBCodeProvider implementation is not currently as much tested as our
CSCodeProvider. Also VBCodeCompiler delegates to mbas (our VB.NET
Compiler) the hard work of compiling and our compiler is at alpha
and currently is so slow that it times out inside the ASP.NET

Just as a comment: Delegation to the command line compilers is the
approach taken by Microsoft and Mono, for each *CodeCompiler class
implementation currently distributed. A process is spawn to compile
temporary source-file created with the *CodeProvider, and it's output
captured and parsed to expose found errors in the ASP.NET way.

I hope this bring some light, on why we still recommend to currently
only C# ASP.NET pages with Mono/mod_mono/xsp.

If all your code can be placed in code-behind dlls, that you compile
with vbc on windows (by using VS.NET), you may try run then on Mono,
our Microsoft.VisualBasic.dll implementation may not be complete
for you to have a smooth ride.


On Tue, 2004-10-12 at 14:54, David P. Donahue wrote:
> Likely.  I recall that coming up before in my quest.  When you say
> default" are you implying that there's a way to use other libraries
> instead?
> Regards,
> David P. Donahue
> ddonahue@ccs.neu.edu 
> > -----Original Message-----
> > From: mono-list-admin@lists.ximian.com 
> > [mailto:mono-list-admin@lists.ximian.com] On Behalf Of Dan Maltes
> > Sent: Tuesday, October 12, 2004 12:18 PM
> > To: 'David P. Donahue'; mono-list@lists.ximian.com 
> > Subject: RE: [Mono-list] Language Clarification
> > 
> > 
> > Is your Grid sample referencing anything in 
> > Microsoft.VisualBasic.dll?  I
> > believe VS.NET references this library by default when 
> > compiling VB.NET
> > projects.
> > 
> > -Dan 
> > 
> > -----Original Message-----
> > From: mono-list-admin@lists.ximian.com 
> > [mailto:mono-list-admin@lists.ximian.com] On Behalf Of David 
> > P. Donahue
> > Sent: Tuesday, October 12, 2004 11:21 AM
> > To: mono-list@lists.ximian.com 
> > Subject: [Mono-list] Language Clarification
> > 
> > I realize that Mono focuses its development on C# as a whole, but
> > wondering something about other languages in general.  I'm no 
> > expert on the
> > core of .NET, but I was under the impression that one of its 
> > features is
> > that code from any .NET language, when compiled, becomes a 
> > single common
> > language for any .NET interpreter (such as Mono) to use.
> > That is, if I write something in VB and compile it in Visual 
> > Studio, the end
> > result is no different (not critically different, anyway) from the
> > result that would be achieved had I used C# or any other .NET 
> > language.  Is
> > this the case?
> > 
> > If so, then I'm unclear on a problem that I've been having 
> > (and have been
> > receiving very help assistance on, thanks to this mailing 
> > list) in trying to
> > get an ASP .NET web application written in VB to work on Mono.
> > 
> > I was told of a work-around to get my first test page to 
> > work, which was to
> > set the page language to C# even though my code-behind was all in
> > This worked... for that small test page (which consisted of a 
> > button which,
> > when pressed, changed a property on a label).  My next test 
> > was to use a
> > DataGrid and grab a table from a database.  This page is slightly
> > complex as a test, since it has more functions in the 
> > code-behind and has
> > some VB code in the design of the .aspx file itself.
> > The aforementioned work-around doesn't seem to extend this 
> > far, as setting
> > my page language to C# now results in a vague "object 
> > reference not set to
> > an instance of an object" error (with no obvious mention of 
> > the object in
> > question).  And, of course, setting it back to VB results in 
> > a "thread was
> > being aborted" error that caused the need for the aforementioned
> > work-around.
> > 
> > If my originally mentioned impression of how .NET works is 
> > correct, why is
> > there a difference between the two at all?  When I compile my 
> > "solution" in
> > Visual Studio, isn't the resulting .dll in the bin folder 
> > contain all that
> > Mono needs?  If so, is my method of compilation not accomplishing
> > properly?
> > 
> > For reference, I am using the following setup:
> > Development:
> >   Windows XP, .NET Framework 1.1.4322, Visual Studio .NET 2003
> > (7.1.3088)
> > Production:
> >   Slackware 10.0, Linux 2.4.26, Mono 1.1.1 (mod_mono with 
> > Apache 1.3.31)
> > 
> > 
> > 
> > Regards,
> > David P. Donahue
> > ddonahue@ccs.neu.edu 
> > 
> > _______________________________________________
> > Mono-list maillist  -  Mono-list@lists.ximian.com 
> > http://lists.ximian.com/mailman/listinfo/mono-list 
> > 
> > 
> > _______________________________________________
> > Mono-list maillist  -  Mono-list@lists.ximian.com 
> > http://lists.ximian.com/mailman/listinfo/mono-list 
> > 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com 
> http://lists.ximian.com/mailman/listinfo/mono-list 
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: VirusScan / Atualizado em 06/10/2004 / Verso: 1.5.2
> Proteja o seu e-mail Terra: http://www.emailprotegido.terra.com.br/ 
> E-mail classificado pelo Identificador de Spam Inteligente Terra.
> Para alterar a categoria classificada, visite
Rafael "Monoman" Teixeira 
Mono Hacker since 16 Jul 2001 - http://www.go-mono.org/
Mono Brasil Founding Member - http://monobrasil.redesolbrasil.org/
English Blog: http://monoblog.blogspot.com/ 
Brazilian Portuguese Blog: http://monoblog.weblogger.terra.com.br/ 

Mono-list maillist  -  Mono-list@lists.ximian.com