Troubleshooting ASP.NET site

In most cases the error should display on the screen.

However if it does not you can enable error reporting by editing your web.config file and adding the following inbetween <system.web> and /<system.web> tags:

<customErrors mode="Off"/>

Once done a more detailed error should appear on screen.

The error usually will indicate what the issue is.

If missing libraries. You may not be referencing the libraries to be used correctly within the web.config file

or 

more common is that the DB details are incorrect or missing or the db connection name does not match.


For example this error is returned from a particular site:

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

Server Error in '/' Application.


Could not find connection string with name 'conn' in application config file

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Could not find connection string with name 'conn' in application config file

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

As the error above indicates the connection name is wrong. Hence the connection string must be changed to the following in the web.config file:

<add name="conn" connectionString="Data Source=dbserveriporhostname;Persist Security Info=True;Initial Catalog=dbname;User ID=dbusername;Password=dbpassword;MultipleActiveResultSets=True;" ProviderName="System.Data.SqlClient" />




  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Do your windows shared hosting accounts support MVC4 and MCV5?

Only our Plesk Windows Shared Hosting accounts support MVC4 and MCV5 applications. When you...

Sending Email via C# and ASP.NET

Add the following to your web.config file:  <system.net>    <mailSettings>...

Force to HTTPS

In the following example we will redirect HTTP to HTTPs using URL Rewrite:Edit your web.config...

How do I enable detailed error messages in the web.config of my website?

Detailed Errors allows for debugging errors in your websites code. Without detailed errors...

ASP.NET Session Timeout

This in-depth analysis helps you know the problem and workaround when you experienced ASP.NET...

Powered by WHMCompleteSolution