Debugging C# in Visual Studio

Discussion in 'MCAD' started by Allen Stroy, Sep 22, 2004.

  1. Allen Stroy

    Allen Stroy Guest

    I am a rookie C# Web Developer, with Visual Studio running
    on Windows 2000. I am trying to get my environment to
    debug properly. I am trying to cause a compilation error,
    but I keep getting the HTTP 500 page. I expected to see
    the compilation error in the browser. I have listed the
    basic code below. Please help!!

    ---------------------------------------------------------

    <!-- StepByStep1_1.aspx -->
    <%@ Page Language='C#' %>
    <html><head>
    <script runat="server">
    double ToCelsius(double f)
    {
    return (5.0/9.0)*(f-32.0);
    }
    </script></head>
    <body>
    <h2>Fahrenheit to Celsius Conversion Chart</h2>
    <table border="2">
    <tr>
    <th>&deg Fahrenheit</th><th>&deg Celsius</th>
    </tr>
    <%
    for (double f = 50.0; f<=100.0; f++)
    {
    // Sends formatted output to HTTP Response
    Response.Output.Write(
    "<tr><td>{0}</td><td>" +
    "{1:f}</td></tr>", f, ToCelsius(f));
    }
    Cause Compilation Error
    %>
    </table>
    </body>
    </html>

    ---------------------------------------------------------

    Thanks,
    Allen Stroy
     
    Allen Stroy, Sep 22, 2004
    #1
    1. Advertising

  2. Allen Stroy

    Marina Guest

    Allen, you cann't see compilation error in the browser -
    you will see the run-time error in the browser. To see
    the compilation error you have to compile (build/re-
    build) the project.

    Hope this helps

    >-----Original Message-----
    >I am a rookie C# Web Developer, with Visual Studio

    running
    >on Windows 2000. I am trying to get my environment to
    >debug properly. I am trying to cause a compilation

    error,
    >but I keep getting the HTTP 500 page. I expected to see
    >the compilation error in the browser. I have listed the
    >basic code below. Please help!!
    >
    >---------------------------------------------------------


    >
    ><!-- StepByStep1_1.aspx -->
    ><%@ Page Language='C#' %>
    ><html><head>
    ><script runat="server">
    > double ToCelsius(double f)
    > {
    > return (5.0/9.0)*(f-32.0);
    > }
    ></script></head>
    ><body>
    ><h2>Fahrenheit to Celsius Conversion Chart</h2>
    > <table border="2">
    > <tr>
    > <th>° Fahrenheit</th><th>° Celsius</th>
    > </tr>
    > <%
    > for (double f = 50.0; f<=100.0; f++)
    > {
    > // Sends formatted output to HTTP Response
    > Response.Output.Write(
    > "<tr><td>{0}</td><td>" +
    > "{1:f}</td></tr>", f, ToCelsius(f));
    > }
    > Cause Compilation Error
    > %>
    > </table>
    ></body>
    ></html>
    >
    >---------------------------------------------------------


    >
    >Thanks,
    >Allen Stroy
    >
    >.
    >
     
    Marina, Sep 23, 2004
    #2
    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. Jaime
    Replies:
    2
    Views:
    594
    Jaime
    Sep 20, 2003
  2. ¢harlie
    Replies:
    0
    Views:
    804
    ¢harlie
    Dec 26, 2003
  3. Jimmy Dean
    Replies:
    3
    Views:
    1,244
    Duane Arnold
    Jul 25, 2005
  4. =?Utf-8?B?VmlqYXk=?=

    Should I write Visual studio 2005 or Visual studio 2003 MCSD

    =?Utf-8?B?VmlqYXk=?=, Jun 29, 2006, in forum: Microsoft Certification
    Replies:
    14
    Views:
    1,090
    Simon Hart
    Jun 30, 2006
  5. TJ
    Replies:
    1
    Views:
    389
    =-Zero@HK-=ASP.Net / VB
    Sep 23, 2005
Loading...

Share This Page