VBNC Error: Handles Clause?

View: New views
4 Messages — Rating Filter:   Alert me  

VBNC Error: Handles Clause?

by MonoNewbie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am a new Mono user, and have the following goal. Basically, I would like to develop ASP.NET sites in Visual Web Developer Express 2008 using Visual Basic and serve the ASP.NET sites on Centos 4 with Mono. .

I have created a simple ASP.NET page with the following code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:Button ID="TestButton" runat="server" Text="Button" />
        <asp:Label ID="CountLabel" runat="server" Text="Please click the button!"></asp:Label>
   
    </div>
    </form>
</body>
</html>

And here is the code-behind:


Partial Class _Default

    Inherits System.Web.UI.Page

    Protected Sub TestButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TestButton.Click



        CountLabel.Text = "You clicked the button!"

    End Sub

End Class


I am currently using the web.config file that comes with the "test" XSP server...

I get the following error when I try loading the page.

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/apache-temp-aspnet-0/9bc357e7/App_Web_57841eb3_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) [0x00000]
at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection, vbnc.ResolveInfo Info) [0x00000]
at vbnc.BaseList`1[vbnc.EventMemberSpecifier].ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.HandlesClause.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.HandlesOrImplements.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.SubDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection, vbnc.ResolveInfo Info) [0x00000]
at vbnc.BaseObjects`1[vbnc.IMember].ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.TypeDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.ClassDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.AssemblyDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.Compiler.Compile_Resolve () [0x00000]
at vbnc.Compiler.Compile () [0x00000]
Compilation took 00:00:04.8297640

/Default.aspx


When I remove the "Handles" clause, the page loads, but of course doesn't function properly.

If I create the equivalent page using C# instead, everything works fine.

I have read that there might be a known error regarding the Handles clause... has this been resolved? Is it relevant to the error I am receiving?

I have installed the latest 1.9.1 version of Mono with yum, but I am not sure I have the latest version of mono-basic. How can I check that?

Thanks for any help!





Re: VBNC Error: Handles Clause?

by A. Leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I had the same problem, what I did was to remove the handles clause and to add the call to the procedure in the control tag in the aspx page. So in your example it would look like this:

<asp:Button ID="TestButton" runat="server" Text="Button"  onclick="TestButton_Click"/>

It worked for me, hope it works for you too.


MonoNewbie wrote:
Hi,

I am a new Mono user, and have the following goal. Basically, I would like to develop ASP.NET sites in Visual Web Developer Express 2008 using Visual Basic and serve the ASP.NET sites on Centos 4 with Mono. .

I have created a simple ASP.NET page with the following code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:Button ID="TestButton" runat="server" Text="Button" />
        <asp:Label ID="CountLabel" runat="server" Text="Please click the button!"></asp:Label>
   
    </div>
    </form>
</body>
</html>

And here is the code-behind:


Partial Class _Default

    Inherits System.Web.UI.Page

    Protected Sub TestButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TestButton.Click



        CountLabel.Text = "You clicked the button!"

    End Sub

End Class


I am currently using the web.config file that comes with the "test" XSP server...

I get the following error when I try loading the page.

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/apache-temp-aspnet-0/9bc357e7/App_Web_57841eb3_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) [0x00000]
at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection, vbnc.ResolveInfo Info) [0x00000]
at vbnc.BaseList`1[vbnc.EventMemberSpecifier].ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.HandlesClause.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.HandlesOrImplements.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.SubDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection, vbnc.ResolveInfo Info) [0x00000]
at vbnc.BaseObjects`1[vbnc.IMember].ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.TypeDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.ClassDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.AssemblyDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
at vbnc.Compiler.Compile_Resolve () [0x00000]
at vbnc.Compiler.Compile () [0x00000]
Compilation took 00:00:04.8297640

/Default.aspx


When I remove the "Handles" clause, the page loads, but of course doesn't function properly.

If I create the equivalent page using C# instead, everything works fine.

I have read that there might be a known error regarding the Handles clause... has this been resolved? Is it relevant to the error I am receiving?

I have installed the latest 1.9.1 version of Mono with yum, but I am not sure I have the latest version of mono-basic. How can I check that?

Thanks for any help!




Re: VBNC Error: Handles Clause?

by Rolf Bjarne Kvinge-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>
> When I remove the "Handles" clause, the page loads, but of course
> doesn't function properly.
>
> If I create the equivalent page using C# instead, everything works
> fine.
>
> I have read that there might be a known error regarding the Handles
> clause... has this been resolved? Is it relevant to the error I am
> receiving?

Yes, it´s a known bug which has already been filed. It hasn´t been fixed yet
though.

>
> I have installed the latest 1.9.1 version of Mono with yum, but I am
> not sure I have the latest version of mono-basic. How can I check that?

"rpm -qa | grep mono-basic" might work, but know nothing about yum.

However as I said this bug hasn't been fixed yet, so installing a newer
version won't help.


Rolf

> Thanks for any help!
>
>
>
>
>
> --
> View this message in context: http://www.nabble.com/VBNC-Error%3A-
> Handles-Clause--tp17676010p17676010.html
> Sent from the Mono - VB mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-vb mailing list
> Mono-vb@...
> http://lists.ximian.com/mailman/listinfo/mono-vb
> No virus found in this incoming message.
> Checked by AVG.
> Version: 8.0.100 / Virus Database: 270.0.0/1486 - Release Date:
> 05/06/2008 18:29

_______________________________________________
Mono-vb mailing list
Mono-vb@...
http://lists.ximian.com/mailman/listinfo/mono-vb

Re: VBNC Error: Handles Clause?

by MonoNewbie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, that did work.