I'm having a little trouble overloading methods in C#. I have two methods that look like this.
public static void Sample(string string1, string string2, string string3,
System.Windows.Forms.MessageBoxButtons buttons)
{}
public static void Sample(string string1, string[] string2, string string3, System.Windows.Forms.MessageBoxButtons buttons)
{}
When I try to call the second method I get an error "Cannot convert 'string[]' to 'string'". What am I doing wrong?
It works when I overload methods that do not take the MessageBoxButtons enumeration, but not for this method.
Calling code looks like this.
string[] myStringArray = new string[] {"this is a test","of overloaded methods"};
Sample("String1",myStringArray,"String2",System.Windows.Forms.MessageBoxButtons.OK);
Edit: The problem was in my build script. It was not waiting for the dll to be created before creating the next dll that referenced the first, so changes that where made where not in the dll that was being referenced.
Guess this is a pitfall of not using an IDE.