Link to home
Start Free TrialLog in
Avatar of wenyonk
wenyonk

asked on

ConfigurationException(string, System.Exception)' is obsolete

Please help!!

I have been unable to resolve the following warning: System.Configuration.ConfigurationException.ConfigurationException(string, System.Exception)' is obsolete: 'This class is obsolete, to create a new exception create a System.Configuration!System.Configuration.ConfigurationErrorsException'

internal static void LogAndThrowException(Exception e)
{
        string string1 = ResourceLoader.Instance.GetString(ResourceNamespaceEnum.ExceptionMessages, e.GetType().FullName, new object[0]);
        throw new ConfigurationException((string1, e);

}  // END: internal static void LogAndThrowException(Exception e)
Avatar of dungla
dungla
Flag of Viet Nam image

What is your .NET version?

You can try to throw new Exception instead of ConfigurationException
ASKER CERTIFIED SOLUTION
Avatar of ozymandias
ozymandias
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wenyonk
wenyonk

ASKER

If worked after i added a reference to System.Configuration

I already added using System.Configuration but forgot to add the reference...

Thank you