Hello,
I'm attempting to set the DecoderFallback property of an arbitrary (but supported) encoding in my C# app. Essentially what i'm trying to do is this:
ASCIIEncoding ascii = new ASCIIEncoding();
ascii.DecoderFallback = new DecoderExceptionFallback();
I'm getting an exception i've never seen before:
System.InvalidOperationException was unhandled Message="Instance is read-only." Source="mscorlib"
StackTrace: at System.Text.Encoding.set_DecoderFallback(DecoderFallback value) at <... into my app...> InnerException:
I was unable to find any MSDN documenation with examples of how to use that property. If anyone could point me to some maybe suggest what is wrong my usage I'd appreciate it. I need to throw an exception upon failure to decode a byte or bytes and cannot afford to let that go unnoticed.
Thanks, brian