[mono-vb] Vb.net Compilation Error

Rolf Bjarne Kvinge rolflists at ya.com
Mon May 5 17:50:07 EDT 2008


The Button1 variable is probably declared in a partial class in another file
(so you get a duplicate declaration)

 

What I suppose you can do is to add then handler manually ("AddHandler
Button1.Click, Button1_Click" in an overridden Load method for instance)

 

Rolf

 

From: Nick Jolin [mailto:njolin at cvikota.com] 
Sent: lunes, 05 de mayo de 2008 20:33
To: 'Rolf Bjarne Kvinge'
Subject: RE: [mono-vb] Vb.net Compilation Error

 

Hi, I'm sorry,  if I remove the Handles, then the button event does not
fire.  And if I add Private WithEvents Button 1 as Button,  It says its
already declared?

 

 

 

Thank you for your help.

Nick

 

 

 

From: Rolf Bjarne Kvinge [mailto:rolflists at ya.com] 
Sent: Monday, May 05, 2008 11:49 AM
To: 'Nick Jolin'; mono-vb at lists.ximian.com
Subject: RE: [mono-vb] Vb.net Compilation Error

 

Hi,

 

This looks like a known bug (regarding WithEvents/Handles clauses, if you
remove the Handles clause or add the missing WithEvents clause it should
compile).

 

Rolf

 

From: mono-vb-bounces at lists.ximian.com
[mailto:mono-vb-bounces at lists.ximian.com] On Behalf Of Nick Jolin
Sent: lunes, 05 de mayo de 2008 17:28
To: mono-vb at lists.ximian.com
Subject: [mono-vb] Vb.net Compilation Error

 

Hi,  I'm new to mono, and I am trying to setup a very simple Asp.net test
webapp.  

Running on Ubuntu 8.04, and Mono 1.9 from compiled from source.

 

In the Page.Load I have: Response.Write("it is working"), and this works
just fine, rendering on the page.

 

If I add a button, with a response.write("it worked"), I get a compilation
error:

 

It seems that if I add any kind of control to the page, it errors out.  If I
precompile the website in vs2005, - then it works fine.

 

Am I doing something wrong?

 

Thanks

Nick

Compilation Error

Description: Error compiling a resource required to service this request.
Review your source file and modify it to fix this error. 

Compiler Error Message: (0,0) : error VBNC_CRASH: Visual Basic.Net Compiler
version 0.0.0.5851
Copyright (C) 2004-2007 Rolf Bjarne Kvinge. All rights reserved.


/tmp/www-data-temp-aspnet-0/eb3a30fb/App_Web_179e9399_1.vb (12,18) : Warning
VBNC99998: Option Strict Off will probably fail.
Error : VBNC99999: Unexpected error: Cannot cast from source type to
destination type.
at vbnc.EventMemberSpecifier.ResolveCode (vbnc.ResolveInfo Info) [0x00124]
in /home/mono-basic-1.9/vbnc/vbnc/source/Members/EventMemberSpecifier.vb:102

at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection,
vbnc.ResolveInfo Info) [0x00044] in
/home/mono-basic-1.9/vbnc/vbnc/source/General/Helper.vb:2338 
at vbnc.BaseList`1[vbnc.EventMemberSpecifier].ResolveCode (vbnc.ResolveInfo
Info) [0x00000] in
/home/mono-basic-1.9/vbnc/vbnc/source/Members/BaseList~1.vb:31 
at vbnc.HandlesClause.ResolveCode (vbnc.ResolveInfo Info) [0x00000] in
/home/mono-basic-1.9/vbnc/vbnc/source/Members/HandlesClause.vb:45 
at vbnc.HandlesOrImplements.ResolveCode (vbnc.ResolveInfo Info) [0x00000] in
/home/mono-basic-1.9/vbnc/vbnc/source/Members/HandlesOrImplements.vb:90 
at vbnc.SubDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00013] in
/home/mono-basic-1.9/vbnc/vbnc/source/Members/SubDeclaration.vb:120 
at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection,
vbnc.ResolveInfo Info) [0x00044] in
/home/mono-basic-1.9/vbnc/vbnc/source/General/Helper.vb:2338 
at vbnc.BaseObjects`1[vbnc.IMember].ResolveCode (vbnc.ResolveInfo Info)
[0x00000] in
/home/mono-basic-1.9/vbnc/vbnc/source/General/BaseObjects`1.vb:65 
at vbnc.TypeDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x0001c] in
/home/mono-basic-1.9/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb:48
7 
at vbnc.ClassDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00002] in
/home/mono-basic-1.9/vbnc/vbnc/source/TypeDeclarations/ClassDeclaration.vb:1
25 
at vbnc.AssemblyDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x0002a] in
/home/mono-basic-1.9/vbnc/vbnc/source/TypeDeclarations/AssemblyDeclaration.v
b:209 
at vbnc.Compiler.Compile_Resolve () [0x001a9] in
/home/mono-basic-1.9/vbnc/vbnc/source/General/Compiler.vb:424 
at vbnc.Compiler.Compile () [0x0028a] in
/home/mono-basic-1.9/vbnc/vbnc/source/General/Compiler.vb:557 
Compilation took 00:00:01.9909480

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-vb/attachments/20080505/b03c8d8a/attachment-0001.html 


More information about the Mono-vb mailing list