Software⏱️ 3 min read📅 2026-06-04

How to Fix: "Exception has been thrown by the target of an invocation" error (mscorlib)

ASP.Net 2.0 error with 'Exception has been thrown by the target of an invocation' in production environment.

Quick Answer: Check for compatibility issues between new Membership controls and existing code, and ensure that all stored procedures and tables are correctly referenced.

The 'Exception has been thrown by the target of an invocation' error in ASP.Net 2.0 is a frustrating issue that can occur due to various reasons. This error specifically affects web applications that use the .NET Framework and is usually caused by issues with the runtime environment or the application's code.

This error can be particularly challenging to diagnose, especially when it was not present in development environments. However, with a thorough investigation of the changes made before uploading to production, we can identify potential causes and apply fixes accordingly.

🛑 Root Causes of the Error

  • The primary cause of this error is likely related to issues with the runtime environment or the application's code. One possible reason could be a mismatch between the .NET Framework version used in development and production environments. Another possibility is a problem with the Membership controls, such as incorrect configuration or data inconsistencies.
  • An alternative cause could be a bug in one of the stored procedures or tables added recently. It's also possible that there are issues with database connections or data access patterns.

🚀 How to Resolve This Issue

Resolving .NET Framework Version Mismatch

  1. Step 1: Check the .NET Framework version used in development and production environments to ensure they match.
  2. Step 2: Verify that the correct version of the .NET Framework is installed on the production server.
  3. Step 3: If necessary, update the .NET Framework version on the production server to match the development environment.

Resolving Membership Control Issues

  1. Step 1: Review the configuration of the Membership controls and ensure they are set up correctly.
  2. Step 2: Verify that data is consistent across all relevant tables and stored procedures.
  3. Step 3: If necessary, update or modify the Membership controls to resolve any issues.

✨ Wrapping Up

To resolve the 'Exception has been thrown by the target of an invocation' error in ASP.Net 2.0, it's essential to identify the root cause of the issue and apply the correct fix. By following the steps outlined above, you should be able to resolve this error and ensure your web application runs smoothly.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions