Knowledgebase

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

Sending Email via C# and ASP.NET

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

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...

How to Enable ASP.NET Debugging in Plesk

here may be times you need to see more logging or debugging information for your ASP.NET...

ASP.NET Session Timeout

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

Can I use ASP.NET State Service?

ASP.NET state service is not enabled due to the fact on shared hosting it keeps the session alive...