Skip to content

Index was out of range on /p:CoverletOutputFormat=\"cobertura,opencover\" #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
elvirdolic opened this issue Jun 27, 2018 · 4 comments
Closed
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@elvirdolic
Copy link

elvirdolic commented Jun 27, 2018

By providing multiple outputformats we get this error

dotnet test myProject.csproj --no-build --configuration release --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura,opencover" /p:CoverletOutputDirectory=C:\temp\coverage --results-directory C:\temp

\coverlet.msbuild.targets(23,5): error : Index was out of range. Must be non-negative and less than the size of the collection. [C:\git\MyProject.Tests\MyProject.Tests.csproj]
C:\Users\xxx.nuget\packages\coverlet.msbuild\2.0.1\build\netstandard2.0\coverlet.msbuild.targets(23,5): error : Parameter name: index [C:\git\MyProject.Tests\MyProject.Tests.csproj]

@tonerdo
Copy link
Collaborator

tonerdo commented Jun 28, 2018

Woah, this is a first. Will take a look, shouldn't be too hard to fix

@tonerdo tonerdo added bug Something isn't working help wanted good first issue Good for newcomers labels Jun 28, 2018
@andre-castro-garcia
Copy link

I have updated to the last version from Nuget (v2.0.1) and cannot reproduce this error in my tests.
I have executed the following command and both files are generate in folder:

dotnet test test/ducktales.tests/ducktales.tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=\"cobertura,opencover\" /p:CoverletOutputDirectory=coverage /p:Exclude="[NUnit3.*]*"

Calculating coverage result...
Generating report 'coverage\coverage.cobertura.xml'
Generating report 'coverage\coverage.opencover.xml'

My repo url:
https://bitbucket.org/andre-castro-garcia/ducktales
(I use the bitbucket because a native integration with bitbucket pipelines and sonarcloud)

@elvirdolic you can shared your repository or code snippet from your test project?

Andre Garcia

@elvirdolic
Copy link
Author

elvirdolic commented Jul 4, 2018

By using this /p:CoverletOutputFormat=\"cobertura,opencover\" it does work. But somehow on VSTS this escaping doesn't work correctly. Thx for your support!!

@Zod-
Copy link

Zod- commented Jul 20, 2018

I had the same problem both locally and on VSTS.
I got it fixed by adding this to my project file as described in #72

  <PropertyGroup>
    ...
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    ...
  </PropertyGroup>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants