1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How To Upload A Simple ASP.NET Application To Prevent The Error

Discussion in 'C#' started by pooyadavoodi, Jan 15, 2008.

  1. #1
    I am a professional programmer with c++ and c# but web development.
    This is my first attempt:
    I open the visual studio 2005 and create an asp.net website. then without any changes to this project, I upload it to a web server that I've bought but when I write the url in the browser, see this error:


    Server Error in '/' Application.
    Runtime Error
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
    ...


    I've tested these methods to deploy the website but no one works:
    1- copy all the files and folders of the project to www of the server by a ftp program
    2- publish the website by vs2005 and copy the results to the server
    3- copy the website by vs2005 to the server

    but when I copy the project to localhost of my winXP IIS, I can run the application. I don't know the problem is in my project eg. configuration) or the server or the method of uploading.

    Thanks in advance for your help.
     
    pooyadavoodi, Jan 15, 2008 IP
  2. JohnZing

    JohnZing Peon

    Messages:
    109
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Change your web.config file (website root).
    edit or Add if there is no customErrors entry
    to
    <customErrors mode="Off"/>

    So you can see the REAL error message
     
    JohnZing, Jan 15, 2008 IP
  3. pooyadavoodi

    pooyadavoodi Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for the attention,
    this is the web.config file:
    ------------------------------------
    <?xml version="1.0"?>
    <configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
    <compilation debug="true"/>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>
    -------------------------------------
    the project has 3 files and an empty folder:
    Default.aspx - Default.aspx.cs - Web.Config - App_Data

    and I upload all of them.
    The error page:
    ---------------------------------------------------------------
    Server Error in '/' Application.
    Runtime Error
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>


    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>
    -------------------------------------------------------------------------------------------
     
    pooyadavoodi, Jan 15, 2008 IP
  4. charlesm3

    charlesm3 Active Member

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    Is your ASP.NET version correct on the server side? You can get this error if you're coding in 2.0 on your local machine but the server has your application set as a 1.1 app.
     
    charlesm3, Jan 16, 2008 IP
  5. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #5
    1. Check the .Net version which you are using.
    2. If you are uploading the application other folder than the root folder of your site then the folder should be created as an application folder.

    Thanks,

    Kailash
     
    kailash, Jan 16, 2008 IP
  6. pooyadavoodi

    pooyadavoodi Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks,
    ASP.NET version in my computer is 2.0 but in the server was 1.1. I changed that and now it is working.

    But another question about the 2nd point of kailash: In the hosting software, there isn't any place to set a folder as an application folder. I can only create an application by an ftp program or the Folder Manager from the control panel of the website. The software is Hosting Controller 6.1. I think when I create a folder in the server, it creates a virtual directory in IIS automatically. My application now is in a folder that is in www of the server and it is working now.
     
    pooyadavoodi, Jan 17, 2008 IP
  7. pooyadavoodi

    pooyadavoodi Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi kailash,
    you said true about application folder. but another problem. I wrote two programs. first one could be run on my computer without creating any application folder. but the 2nd one couldn't be run till I create an application folder in IIS.
    the 1st one has a button and a textbox. and the 2nd one use an access database. is it because of the database?

    thanks.
     
    pooyadavoodi, Jan 17, 2008 IP
  8. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #8
    Hi pooyadavoodi,

    The root folder of the website is by default works as an application folder. If you upload your application inside the root folder viz. /www/myapps/ then you will need to create myapps folder as an application folder. Also sometime ASP.Net 2 application doesn't require the folder as an application folder but I am not sure about it.

    Kailash
     
    kailash, Feb 7, 2008 IP
  9. vbrocks

    vbrocks Active Member

    Messages:
    90
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    98
    #9
    Hi,

    when deploying your .NET web application all you need is to upload:
    - all required html, aspx, ascx, js, css files
    - web.config
    - BIN folder with all its contents
    - all referenced dlls (they are usually in the bin folder)
    - all required images
    - NO need to upload .CS, or .resx files, they are your intellectual property.
    - NO need to upload OBJ folder.

    All directory structure should be set up the way it is done on your development machine.

    Next,
    check the version of the Framework the host uses - must be 2.0 or later if you use VS 2005.

    Then,
    verify the contents of the web.config file. If it contains connection strings, they must be valid in terms of the database authentication and the server they point to. Needless to say, if your site uses any database, that database should be deployed and properly set up.

    Set up the default page.

    Regards.
     
    vbrocks, Feb 9, 2008 IP
  10. Yankee85

    Yankee85 Peon

    Messages:
    1,067
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Thanks vbrocks!
     
    Yankee85, Apr 25, 2008 IP
  11. medha889

    medha889 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Hello there! Well I am receiving this message while I was viewing a page and now what should I do please help I don't know anything what to do.

    Server Error in '/' Application.
    Runtime Error
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>


    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>
     
    medha889, May 19, 2010 IP