ICustomFormatter fails in .Net 2.0

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
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top