ICustomFormatter fails in .Net 2.0

  • Thread starter Thread starter sjoshi
  • Start date Start date
S

sjoshi

Hello
I have a class that worked in 1.1 but fails now on 2.0 on same data.
Any ideas are appreciated.

public class TSFormatter: IFormatProvider, ICustomFormatter
{
#region IFormatProvider Members

public object GetFormat(Type format)
{
return this;
}
#endregion

#region ICustomFormatter Members

public string Format(string format, object arg, IFormatProvider
formatProvider)
{
return BitConverter.ToInt64(((byte[])arg), 0).ToString(); //** Fails
here ***

//Message="Unable to cast object of type 'System.Int32' to
type 'System.Byte[]'."
}

#endregion
}



thanks
Sunit
 
Standard question #1:
What do you mean by "not working"?

Standard question #2:
What error message do you get?
 
Back
Top