You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/KnownIssues.md
+32-31Lines changed: 32 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,8 @@
16
16
17
17
```bash
18
18
Calculating coverage result...
19
-
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\2.6.0\build\netstandard2.0\coverlet.msbuild.targets(21,5): warning : [coverlet] Hits file:'C:\Users\REDACTED\AppData\Local\Temp\testApp_ac32258b-fd4a-4bb4-824c-a79061e97c31' not found for module: 'testApp' [C:\Users\REDACTED\Documents\repo\testapp\testapp.Tests\testapp.Tests.csproj]
20
-
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\2.6.0\build\netstandard2.0\coverlet.msbuild.targets(21,5): warning : [coverlet] Hits file:'C:\Users\REDACTED\AppData\Local\Temp\testApp.Tests_ac32258b-fd4a-4bb4-824c-a79061e97c31' not found for module: 'testApp.Tests' [C:\Users\REDACTED\Documents\repo\testapp\testapp.Tests\testapp.Tests.csproj]
19
+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\6.0.0\build\netstandard2.0\coverlet.msbuild.targets(21,5): warning : [coverlet] Hits file:'C:\Users\REDACTED\AppData\Local\Temp\testApp_ac32258b-fd4a-4bb4-824c-a79061e97c31' not found for module: 'testApp' [C:\Users\REDACTED\Documents\repo\testapp\testapp.Tests\testapp.Tests.csproj]
20
+
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\6.0.0\build\netstandard2.0\coverlet.msbuild.targets(21,5): warning : [coverlet] Hits file:'C:\Users\REDACTED\AppData\Local\Temp\testApp.Tests_ac32258b-fd4a-4bb4-824c-a79061e97c31' not found for module: 'testApp.Tests' [C:\Users\REDACTED\Documents\repo\testapp\testapp.Tests\testapp.Tests.csproj]
@@ -107,7 +107,7 @@ dotnet test --settings coverage.runsettings
107
107
108
108
*Symptoms:* some tool like SonarSource doesn't work well see <https://github.com/coverlet-coverage/coverlet/issues/482>
109
109
110
-
`Nerdbank.GitVersioning` generates a version file on the fly but this file is not part of user solution and it's not commited to repo so the generated remote source file reference does not exit, i.e.
110
+
`Nerdbank.GitVersioning` generates a version file on the fly but this file is not part of user solution and it's not committed to repo so the generated remote source file reference does not exit, i.e.
111
111
112
112
```text
113
113
...
@@ -118,7 +118,10 @@ dotnet test --settings coverage.runsettings
118
118
*Solution:* we can exclude `Nerdbank.GitVersioning` autogenerated file from instrumentation using filters
119
119
120
120
```bash
121
+
# example for coverlet.msbuild
121
122
/p:ExcludeByFile=\"**/*Json.Version.cs\"
123
+
# example for coverlet.collector
124
+
dotnet test test-assembly.dll /collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile="**/*.Version.cs"
122
125
```
123
126
124
127
## Failed to resolve assembly during instrumentation
@@ -128,7 +131,7 @@ dotnet test --settings coverage.runsettings
128
131
*Symptoms:* during build/instrumentation you may get an exception like:
129
132
130
133
```text
131
-
[coverlet] Unable to instrument module: ..\UnitTests\bin\Debug\netcoreapp2.1\Core.Messaging.dll because : Failed to resolve assembly: 'Microsoft.Azure.ServiceBus, Version=3.4.0.0, Culture=neutral, PublicKeyToken=7e34167dcc6d6d8c' [..\UnitTests.csproj]
134
+
[coverlet] Unable to instrument module: ..\UnitTests\bin\Debug\net6.0\Core.Messaging.dll because : Failed to resolve assembly: 'Microsoft.Azure.ServiceBus, Version=7.16.1.0, Culture=neutral, PublicKeyToken=7e34167dcc6d6d8c' [..\UnitTests.csproj]
132
135
```
133
136
134
137
In the instrumentation phase, Coverlet needs to load all references used by your instrumented module. Sometimes the build phase (out of Coverlet's control) does not copy those dlls to the output folder because they are not resolved till runtime or at publish phase from the NuGet packages folders.
@@ -170,7 +173,7 @@ In this case the only workaround at the moment is to *manually copy* missing dll
170
173
Failed Tests.MinMax.Min_AsyncSelector_Int32_4
171
174
Error Message:
172
175
System.TypeInitializationException : The type initializer for 'Tests.AsyncEnumerableTests' threw an exception.
173
-
---- System.IO.FileLoadException : Could not load file or assembly 'System.Linq.Async, Version=4.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
176
+
---- System.IO.FileLoadException : Could not load file or assembly 'System.Linq.Async, Version=6.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
174
177
Stack Trace:
175
178
at Tests.AsyncEnumerableTests..ctor()
176
179
at Tests.MinMax..ctor()
@@ -180,8 +183,6 @@ Stack Trace:
180
183
181
184
*Solution:* Looks like this is caused by xUnit's app domains. For `dotnet test`, it can be disabled with the following argument: `-- RunConfiguration.DisableAppDomain=true`
182
185
183
-
NB. Workaround doesn't work if test method itself explicitly creates an appdomain and uses shadow copying in order to test that the assembly behaves properly in those conditions.
184
-
185
186
## Code coverage returns NaN%
186
187
187
188
*Symptoms:* You are getting following result when running Coverlet within CI/CD pipeline:
@@ -209,23 +210,23 @@ SUT (System Under Test) assembly is also not listed in MSBuild logs - "Instrumen
209
210
*Symptoms:*
210
211
211
212
```log
212
-
C:\Users\REDACTED\.nuget\packages\coverlet.msbuild\3.2.0\build\coverlet.msbuild.targets(39,5): error : Stream was too long. [REDACTED.csproj]
0 commit comments