Trouble compiling HelloWorld with vbc

Discussion in 'ASP .Net' started by Mister.programmer, Feb 10, 2005.

  1. Hi,

    I can't compile anything with vbc, so i am asking for help please.

    I have a file helloworld.aspx written in asp.net using vb, here it is:



    <script runat="server" language="vb">
    '=============================================================================
    '=============================================================================
    ' HelloWorld.aspx
    '=============================================================================
    '=============================================================================


    ' =====================================================
    ' Begin
    ' =====================================================

    Private Sub Page_Load()
    ' Print "Hello World !"
    Response.write ("Hello World !")
    End Sub
    ' =====================================================
    ' End
    ' =====================================================

    </script>



    Then i have a file compilehelloworld.bat, here it is:



    C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\vbc.exe helloworld.aspx
    /target:library /out:helloworld.dll /reference:System.dll > comp.log



    The file helloworld.aspx works great when i don't compile it, but when
    i execute compilehelloworld.bat, here is the result:



    Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
    for Microsoft (R) .NET Framework version 1.1.4322.573
    Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

    D:\dev\jct\source\helloworld.aspx(1) : error BC30636: '>' expected.

    <script runat="server" language="vb">
    ~~~~~
    D:\dev\jct\source\helloworld.aspx(13) : error BC30001: Statement is
    not valid in a namespace.

    Private Sub Page_Load()
    ~~~~~~~~~~~~~~~~~~~~~~~
    D:\dev\jct\source\helloworld.aspx(21) : error BC30203: Identifier
    expected.

    </script>
    ~


    Can anyone tell me what is wrong ? Thanks.
    Mister.programmer, Feb 10, 2005
    #1
    1. Advertising

  2. Mister.programmer

    Patrice Guest

    You should use "code behind" if you do this. For now you can't compile ASPX
    page, they are compiled on the fly and are pre-processed before compilation
    (for example <script> is not part of the VB.NET language).

    Patrice

    --

    "Mister.programmer" <> a écrit dans le message de
    news:...
    > Hi,
    >
    > I can't compile anything with vbc, so i am asking for help please.
    >
    > I have a file helloworld.aspx written in asp.net using vb, here it is:
    >
    >
    >
    > <script runat="server" language="vb">
    >

    '===========================================================================
    ==
    >

    '===========================================================================
    ==
    > ' HelloWorld.aspx
    >

    '===========================================================================
    ==
    >

    '===========================================================================
    ==
    >
    >
    > ' =====================================================
    > ' Begin
    > ' =====================================================
    >
    > Private Sub Page_Load()
    > ' Print "Hello World !"
    > Response.write ("Hello World !")
    > End Sub
    > ' =====================================================
    > ' End
    > ' =====================================================
    >
    > </script>
    >
    >
    >
    > Then i have a file compilehelloworld.bat, here it is:
    >
    >
    >
    > C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\vbc.exe helloworld.aspx
    > /target:library /out:helloworld.dll /reference:System.dll > comp.log
    >
    >
    >
    > The file helloworld.aspx works great when i don't compile it, but when
    > i execute compilehelloworld.bat, here is the result:
    >
    >
    >
    > Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
    > for Microsoft (R) .NET Framework version 1.1.4322.573
    > Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.
    >
    > D:\dev\jct\source\helloworld.aspx(1) : error BC30636: '>' expected.
    >
    > <script runat="server" language="vb">
    > ~~~~~
    > D:\dev\jct\source\helloworld.aspx(13) : error BC30001: Statement is
    > not valid in a namespace.
    >
    > Private Sub Page_Load()
    > ~~~~~~~~~~~~~~~~~~~~~~~
    > D:\dev\jct\source\helloworld.aspx(21) : error BC30203: Identifier
    > expected.
    >
    > </script>
    > ~
    >
    >
    > Can anyone tell me what is wrong ? Thanks.
    Patrice, Feb 10, 2005
    #2
    1. Advertising

  3. Mister.programmer

    Guest

    Patrice wrote:
    > You should use "code behind" if you do this. For now you can't

    compile ASPX
    > page, they are compiled on the fly and are pre-processed before

    compilation
    > (for example <script> is not part of the VB.NET language).
    >
    > Patrice
    >


    Thank you for this information. Could you give me the equivalent in
    "code behind" for this helloworld.aspx and compilehelloworld.bat ?

    Thanks.
    , Feb 10, 2005
    #3
  4. Mister.programmer

    Guest

    , Feb 11, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian B.
    Replies:
    4
    Views:
    2,310
    Chance Hopkins
    Jul 2, 2003
  2. the_JAVA_Rookie
    Replies:
    5
    Views:
    10,572
    Mickey Segal
    Aug 19, 2003
  3. Guest
    Replies:
    0
    Views:
    3,702
    Guest
    Jan 18, 2004
  4. gluraski

    helloworld portlet

    gluraski, Jun 9, 2005, in forum: Java
    Replies:
    0
    Views:
    381
    gluraski
    Jun 9, 2005
  5. RN1

    Compiling With VBC

    RN1, Mar 15, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    361
Loading...

Share This Page