-
Notifications
You must be signed in to change notification settings - Fork 389
Index was out of range. VSTS #179
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
Comments
Hi @j2ghz can you try this #135 (comment) |
I tried it, still fails. I do have a working branch and a broken branch. @@ -2,16 +2,22 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
-
+ <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
+ <PackageReference Include="AngleSharp" Version="0.9.10" />
- <PackageReference Include="coverlet.msbuild" Version="2.1.1" />
+ <PackageReference Include="coverlet.msbuild" Version="2.2.1">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
+ </PackageReference>
<PackageReference Include="FluentAssertions" Version="5.4.1" />
+ <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.1.2" />
- <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.1.1" />
+ <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="Moq" Version="4.9.0" />
+ <PackageReference Include="Moq.AutoMock" Version="1.2.0.111" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" /> main csproj + <LangVersion>7.3</LangVersion>
+ <DebugType>embedded</DebugType>
+ <DebugSymbols>true</DebugSymbols> I have tried reverting coverlet version upgrade, but it didn't help. Other than that the difference between the branches is I have added some tests. If none of these changes seem suspicious to you I will start reverting one by one and see which one fixes it. |
It was resolved by removing these lines from the main csproj: + <LangVersion>7.3</LangVersion>
+ <DebugType>embedded</DebugType>
+ <DebugSymbols>true</DebugSymbols> |
I know this is closed, but for what it's worth, I was hitting this problem when setting up a new project build pipeline using an app that didn't yet have any implementation. I wanted to get the build pipeline including tests and coverage set up prior to starting work. Anyway, the reason I was getting this error was I hadn't yet referenced the app project from the test project. Adding the following to my test project csproj solved the problem.
It's looking for assemblies with which to measure coverage against and not finding any (obvious now I think about it!). The error message could possibly be a bit clearer? |
Thanks a bunch @csharpsi I had the same exact issue. I was trying to get my CI running and my unit test project just had a blank unit test and was not referencing any logic classes. Saw your message and added the references and it solved the issue. Couldn't agree more the coverlet should handle this more. Between you and me it made at least 2 of us running into the same issue. @tonerdo any comments how we can make this better? |
I get the same error, but only after upgrading to version 2.3.1 of the |
The VSTS agent is running in docker, image:
microsoft/vsts-agent:ubuntu-16.04-standard
. The same test command works locally. I found #135 but I'm not using multiple output formats.I tracked it up to here https://www.fuget.org/packages/coverlet.msbuild/2.2.1/build/netstandard2.0/coverlet.msbuild.tasks.dll/Coverlet.MSbuild.Tasks/CoverageResultTask?code=true#M:Coverlet.MSbuild.Tasks.CoverageResultTask.Execute but I'm not sure where to find the relevant piece of code.
The text was updated successfully, but these errors were encountered: