I have a static method with the following signature

internal static void LogError(string description, string className)

when I call it from a catch block with the following

} catch (Exception ex) {
Util.ErrorLogging.LogError(ex.ToString(), this.GetType().Name);

I get a compile time error "Keyword this is not valid in a static property,
static method, or static field initializer". I had always assumed that this
was a valid way to pass in arguments. Can anyone tell me why this shouldn't
work?

Thanks,
Erick

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to