Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Compile a project
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Compile a project

 Post Reply Post Reply
Author
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Topic: Compile a project
    Posted: 31 October 2003 at 1:35am

When I'm finished developing a asp.net site, and I'll release it, I need to compile it...I have have some questions about it.

Am I correct that I do the following to create the final version:
-in the web.config file:
<compilation defaultLanguage="vb" debug="true" />
Change debug to false

-And in vs.net change the select menu to RELEASE and then build the solution.

Is this all I have to do or are there more things? Do I really need to change the select menu to release?

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2003 at 7:41pm

        <compilation debug="false" />
        <customErrors mode="RemoteOnly"/>

Compiling as "Release" removes the custom debug flags from youe compiled code.

The web.config compilation debug entry set to false prevents asp.net from tracking flags (even if they don't exist) when the code executes.

The changing the customErrors mode from "off" to "RemoteOnly" disables stack traces and detailed debug info from displaying and thereby providing info to hackers.

All 3 also improve performance f your released app.


Lead me not into temptation... I know the short cut, follow me.
Back to Top
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2003 at 10:14am
Ok, and what if I want to build a Class Library? I build it as 'release'...and that's all?
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2003 at 2:24pm

This is copied straight from the VS.NET help, it's explaining how to make high performance applications

As with any programming model, writing code to create an ASP.NET Web application has a number of pitfalls that can cause performance problems. The following guidelines list specific techniques that you can use to avoid writing code that does not perform at acceptable levels.

  • Disable session state when you are not using it. Not all applications or pages require per-user session state, and you should disable it for any that do not.

    To disable session state for a page, set the EnableSessionState attribute in the @ Page directive to false. For example, <%@ Page EnableSessionState="false" %>.

    Note   If a page requires access to session variables, but will not create or modify them, set EnableSessionState attribute in the @ Page directive to ReadOnly.
    Session state may also be disabled for XML Web service methods. For more information, see XML Web Services Created Using ASP.NET and XML Web Service Clients.

    To disable session state for an application, set the mode attribute to off in the sessionstate configuration section in the application's web.config file. For example, <sessionstate mode="off" />.

  • Choose your session-state provider carefully. ASP.NET provides three distinct ways to store session data for your application: in-process session state, out-of-process session state as a Windows service, and out-of-process session state in a SQL Server database. Each has it advantages, but in-process session state is by far the fastest solution. If you are only storing small amounts of volatile data in session state, it is recommended that you use the in-process provider. The out-of-process solutions are primarily useful if you scale your application across multiple processors or multiple computers, or where data cannot be lost if a server or process is restarted. For more information, see ASP.NET State Management.
  • Avoid unnecessary round trips to the server. While it is tempting to use the time and code-saving features of the Web Forms page framework as much as you can, there are circumstances in which using ASP.NET server controls and post-back event handling are inappropriate.

    Typically, you need to initiate round trips to the server only when your application is retrieving or storing data. Most data manipulations can take place on the client in between these round trips. For example, validating user input from HTML forms can often take place on the client before that data is submitted to the server. In general, if you do not need to relay information to the server to be stored in a database, then you should not write code that causes a round trip.

    If you develop custom server controls, consider having them render client-side code for browsers that support ECMAScript. By using server controls in this way, you can dramatically reduce the number of times information is unnecessarily sent to the Web server. For more information, see Developing ASP.NET Server Controls.

  • Use Page.IsPostback to avoid performing unnecessary processing on a round trip. If you write code that handles server control post-back processing, you will sometimes want other code to execute the first time the page is requested, rather than the code that executes when a user posts an HTML form contained in the page. Use the Page.IsPostBack property to conditionally execute code depending on whether the page is generated in response to a server control event. For example, the following code demonstrates how to create a database connection and command that binds data to a DataGrid server control if the page is requested for the first time.
    Sub Page_Load(sender As Object, e As EventArgs)
            ' ...Set up a connection and command here....
            If Not (Page.IsPostBack)
                Dim query As String = "select * from Authors where FirstName like '%JUSTIN%'"
                myCommand.Fill(ds, "Authors")
                myDataGrid.DataBind()
            End If
    End Sub

    Since the Page_Load event executes on every request, this code checks whether the IsPostBack property is set to false. If so, the code executes; otherwise, it does not.

    Note   If you did not run such a check, the behavior of a post-back page would not change. The code for the Page_Load event executes before server control events execute, but only the result of the server control events would render to the outgoing page. If this check is not run, processing is still performed for the Page_Load event and any server control events on the page.
  • Use server controls in appropriate circumstances. Review your application code to make sure that your use of ASP.NET server controls is necessary. Even though they are extremely easy to use, server controls are not always the best choice to accomplish a task, since they use server resources. In many cases, a simple rendering or data-binding substitution will do. The following example demonstrates a situation in which using a server control is not the most efficient way to substitute values into the HTML sent to the client. Each method sends the path to an image to be displayed by the requesting browser, but using server controls is not the most expedient method shown, since the Page_Load event requires a call to the server for processing.
    <script language="VB" runat="server">
    
        Public imagePath As String
        Sub Page_Load(sender As Object, e As EventArgs)
            '...Retrieve data for imagePath here....
            DataBind()
        End Sub
    
    </script>
    
    <%--The span and img server controls are unecessary.--%>
    The path to the image is: <span innerhtml='<%# imagePath %>' runat="server"/><br>
    <img src='<%# imagePath %>' runat="server"/>
    
    <br><br>
    
    <%-- Use data binding to substitute literals instead.--%>
    The path to the image is: <%# imagePath %><br>
    <img src='<%# imagePath %>' />
    
    <br><br>
    
    <%-- Or use a simple rendering expression...--%>
    The path to the image is: <%= imagePath %><br>
    <img src='<%= imagePath %>' />
Gone..
Back to Top
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2003 at 3:13pm

tkx!
I should use that help function more

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.