Hi Mohan,
The Error message displayed is fairly straight forward. This error would happen possibly when there are ambiguous declaration of "Exception" class. I would suggest you to use the complete namespace(prefix the Exception with System) in the catch block as below.
Solution:
try
{
}
catch (System.Exception ex)
{
throw ex;
}
Use the below script to reproduce the error scenario:
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
}
catch (Exception ex)
{
throw ex;
}
}
}
public class Exception
{
}
}