icsharpcode / NRefactory

NRefactory - Refactoring Your C# Code
684 stars 262 forks source link

XmlDocumentationProvider - "output char buffer is too small to contain the decoded characters" #529

Open robdcgnx opened 7 years ago

robdcgnx commented 7 years ago

string file = "Cognex.Designer.Core.xml"; var provider = new XmlDocumentationProvider(file);

throws an ArgumentException when attempting load the attached xml into the XmlDocumentationProvider.

*Had to rename it to .txt instead of .xml Cognex.Designer.Core.txt

Using 5.5.1 pulled from nuget.org

The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8)' fallback 'System.Text.DecoderExceptionFallback'. Parameter name: chars at System.Text.Encoding.ThrowCharsOverflow() at System.Text.Encoding.ThrowCharsOverflow(DecoderNLS decoder, Boolean nothingDecoded) at System.Text.UTF8Encoding.GetChars(Byte bytes, Int32 byteCount, Char chars, Int32 charCount, DecoderNLS baseDecoder) at System.Text.DecoderNLS.Convert(Byte bytes, Int32 byteCount, Char chars, Int32 charCount, Boolean flush, Int32& bytesUsed, Int32& charsUsed, Boolean& completed) at System.Text.DecoderNLS.Convert(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex, Int32 charCount, Boolean flush, Int32& bytesUsed, Int32& charsUsed, Boolean& completed) at ICSharpCode.NRefactory.Documentation.XmlDocumentationProvider.LinePositionMapper.GetPositionForLine(Int32 line) at ICSharpCode.NRefactory.Documentation.XmlDocumentationProvider.ReadMembersSection(XmlTextReader reader, LinePositionMapper linePosMapper, List`1 indexList) at ICSharpCode.NRefactory.Documentation.XmlDocumentationProvider.ReadXmlDoc(XmlTextReader reader) at ICSharpCode.NRefactory.Documentation.XmlDocumentationProvider..ctor(String fileName) at XmlDocProviderBug.Program.Main(String[] args) in C:\Users\rdunbar\Desktop\Temp\XmlDocProviderBug\XmlDocProviderBug\Program.cs:line 15 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()