When working on an ASP.NET application, you frequently run into the error “Server Error in ‘/’ Application.” This generic error happens when an ASP.NET application’s code throws an unhandled exception.
Resolution
The following actions can be taken to fix the Server Error in ‘/’ Application error:
Examine the error message. Usually, the error message will include some details about what went wrong.
Investigate and explore the stack trace. Stack trace aids in identifying the error and its location.
Enable detailed error messages: By default, ASP.NET is configured to display generic error messages. You can enable detailed error messages by modifying the web.config file. Find the <system.web> section in the file and set the customErrors mode to “Off” like this: This will display detailed error messages that can help you identify the problem
<configuration>
<system.web>
<customErrors mode="Off" />
</system.web>
Check your code for any logical or syntactic mistakes that might be the source of the issue.
Look through the web server’s error logs. Server logs typically contain more details to address Server Error in ‘/’ Application error. A lot of information about the error’s location and description can be found in error logs. They will be simpler to fix.
Rebuild and redeploy your application: Rebuild and redeploy your application to the web server after making any modifications.
In the event that your application makes use of a database, confirm that the database is reachable and that the connection string is accurate.
You can fix the Server Error in ‘/’ Application error in your ASP.NET MVC application by following the above steps.