Problem


The application runs great at localhost, but after uploading to hosting server, when login a user or create new admin, this generic error page displayed: Error. An error occurred while processing your request. How to get the detailed error?

Solution


To see the detailed error message, please do the following:

  1. Open Web.config with Visual Studio, add this line <customErrors mode="Off" /> within system.web block, as shown in image below.

    <customErrors mode="Off" />
    

    Untitled

  2. Check whether you use the correct connectionString. Double check your server name, database name, user id and password at your hosting control panel.

    DataSource=**YourServerName**;InitialCatalog=**YourDatabaseName**;UserId=**YourMsSqlDatabaseUserId**;Password=**YourMsSqlDatabasePassword**;
    

    Untitled

  3. After step 1 & 2, build the solution, go to hosting control panel, replace the root “Web.config” file.

  4. Replace “OnlineLearning.dll”, “OnlineLearning.dll.config” and “OnlineLearning.pdb” inside bin folder of your hosting server with the one at your local computer.

  5. On your hosting control panel, turn detailed error to “ON”. If you are not sure where is it, you can send inquiry to the hosting support team.

    Untitled

Now, visit your site, try to create new admin or login any existing user, the detailed error should be displayed and you can know what is the exact issue occurred. Hope this helped. Thank you.