繁体   English   中英

1不是受支持的代码页

[英]1 is not a supported code page

我们在日志中看到该异常:“ 1不是受支持的代码页”。 它在站点上随机发生,并且随机发生,但是始终位于2个位置中的1个位置:读取上载文件的字节流或将字节流写入响应。 该错误很难重现,解决方法是回收存在问题的IIS节点。

文件上传和下载的工作原理几乎一直都在起作用,因此代码确实起作用。 我们没有做任何令人讨厌的事情,例如分离后台线程来进行此处理,但是我们正在使用的各种库可能都是这样。

一些例子:

从C#框架代码:

消息:无法将索引0处的字节[C0]从指定的代码页转换为Unicode。 StackTrace:位于System.Text.DecoderFallbackBuffer.InternalFallback(Byte []字节处,位于System.Text.DecoderExceptionFallbackBuffer.Fallback(Byte [] bytesUnknown,Int32索引处)处System.Text.DecoderExceptionFallbackBuffer.Throw( System.Text.UTF8Encoding.GetChars(Byte *字节,Int32 byteCount,Char *字符,Int32 charCount,DecoderNLS baseDecoder)处的Byte * pBytes,Char *&chars)System.Text.UTF8Encoding.GetChars(Byte [] bytes,Int32 System.Xml.ValueHandle.TryReadChars(Char []字符,Int32偏移量,Int32计数,Int32和实际值)在System.Xml.XmlBaseReader.ReadValueChunk(Char []字符, System.Xml.XmlBinaryWriter.WriteTextNode(XmlDictionaryReader阅读器,布尔属性)处的Int32偏移量,Int32计数)System.Xml.XmlDictionaryWriter.WriteNode(XmlDictionaryReader读取器,布尔defattr)处的System.Xml.XmlBictionaryReader.WriteBody()在System.ServiceModel.C 位于Daptivs.Api.WcfRest.Service处的System.ServiceModel.Channels.Message.OnCreateBufferedCopy(Int32 maxBufferSize,XmlDictionaryReaderQuotas配额)处的hannels.Message.OnWriteMessage(XmlDictionaryWriter writer) System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.AfterReceiveRequestCore(MessageRpc&rpc)的{source中的.source中的.XmlPropertySorterMessageInspector.AfterReceiveRequest(Message&request,IClientChannel channel,InstanceContext instanceContext) System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)处的ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&rpc)源:mscorlib TargetSite:虚空Throw(Byte [],Int32)HelpLink:{NULL}索引:0 ParamName:{ NULL} HResult:-2147024809 BytesUnknown:[Byte []]:哈希码{3297007} {192} 数据:[ListDictionaryInternal]:哈希码{44361946} {} InnerException:{NULL}}

从Aspose.Tasks:

消息:1不是受支持的代码页。 参数名称:codepage StackTrace:位于System.Text.Encoding.GetEncoding(Int32 codepage)位于?。?。?()处于?。?.. ctor(Stream stream)处于?。?。?(Stream stream)处于?。 B。?()at Aspose.Cells.Workbook.?(Stream?,LoadOptions?)at Aspose.Cells.Workbook.?(String?,LoadOptions?)

感谢您抽出宝贵的时间对此进行检查。 我们继续进行挖掘,发现出错的页面与使用Aspose.Cells程序集的页面之间有很强的相关性。 我们相信升级此程序集将解决问题,因为我们使用的程序集已经很老了。

因此,对于将来要解决此问题的任何人:检查并确保所有第三方程序集都处于最新状态。 除非经过证明,否则任何超过两年的年龄都应视为可疑。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM