Problem: No overload for method ‘LogException’ takes 2 arguments.
Description: I have a method which should be able to take additional info optionally, so I added an optional parameter / argument (option 1). That didn’t work, so I tried making 2 methods (option 2). Now I’m pretty sure it isn’t a coding error, but rather something with Visual Studio (2010). I’ve tried cleaning, rebuilding and building (after deleting bin folder), but the error “No overload…” always stops the build process.
Call
catch(Exception e)
{
ServerLog.Instance.LogException(e, (object)info);
}
Implementation option 1
public void LogException(Exception e, object info=null) { ... }
Implementation option 2
public void LogException(Exception e) { LogException(e, null); }
public void LogException(Exception e, object info) { ... }
Paddy was right, wrong reference type. Thanks for your help, and feel free to add your comment as an answer (for the reputation).