Skip to content

Commit 72d5ee2

Browse files
authored
Large CC XML error (#1428)
Adding a problem that I have hit before. It took me a while to understand the error, I resorted to using another code coverage tool that helped me identify why this error was shown. I'm hoping this helps other people who may see this error.
1 parent cb420d2 commit 72d5ee2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Documentation/KnownIssues.md

+30
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,33 @@ NB. Workaround doesn't work if test method itself explicitly creates an appdomai
201201
SUT (System Under Test) assembly is also not listed in MSBuild logs - "Instrumented module" is missing for your dll.
202202

203203
*Solution*: Check whether deterministic build is turned on for your solution, if so, follow the [instructions](DeterministicBuild.md) on how to handle deterministic builds.
204+
205+
## Failure to produce Code Coverage Report
206+
207+
*Symptoms:*
208+
209+
```log
210+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : Stream was too long. [REDACTED.csproj]
211+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) [REDACTED.csproj]
212+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : at System.Xml.XmlStreamNodeWriter.FlushBuffer() [REDACTED.csproj]
213+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : at System.Xml.XmlStreamNodeWriter.GetBuffer(Int32 count, Int32& offset) [REDACTED.csproj]
214+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : at System.Xml.XmlStreamNodeWriter.UnsafeWriteUTF8Chars(Char* chars, Int32 charCount) [REDACTED.csproj]
215+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : at System.Xml.XmlUTF8NodeWriter.WriteEscapedText(String s) [REDACTED.csproj]
216+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : at System.Xml.XmlBaseWriter.WriteString(String value) [REDACTED.csproj]
217+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteString(XmlWriterDelegator xmlWriter, String value, XmlDictionaryString name, XmlDictionaryString ns) [REDACTED.csproj]
218+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : at WriteLineToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract ) [REDACTED.csproj]
219+
220+
....
221+
222+
Calculating coverage result...
223+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(71,5): error : Unexpected end of file. [REDACTED.csproj]
224+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(71,5): error : at System.Xml.EncodingStreamWrapper.ReadBOMEncoding(Boolean notOutOfBand) [REDACTED.csproj]
225+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(71,5): error : at System.Xml.EncodingStreamWrapper..ctor(Stream stream, Encoding encoding) [REDACTED.csproj]
226+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(71,5): error : at System.Xml.XmlUTF8TextReader.SetInput(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose) [REDACTED.csproj]
227+
```
228+
229+
The XML code coverage report is too large for the coverlet to parse.
230+
231+
*Potential Solutions:*
232+
* Reduce noise from auto generated code, for example excluding your EntityFrameworkCore Migrations namespace or automatically generated typed Http Clients. See [Excluding From Coverage](./MSBuildIntegration.md#excluding-from-coverage) for more information on ignoring namespaces from code coverage.
233+

0 commit comments

Comments
 (0)