question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet test on new project built from template fails to run

See original GitHub issue

I get this error when I dotnet test on a new Expecto project:

Starting test execution, please wait… An exception occurred while invoking executor ‘executor://yolodev/expecto’: Method not found: ‘Void ExpectoConfig…ctor(Boolean, Int32, Microsoft.FSharp.Core.FSharpOption1<System.TimeSpan>, System.TimeSpan, Double, Boolean, Microsoft.FSharp.Core.FSharpFunc2<Expecto.Test,Expecto.Test>, TestPrinters, Expecto.Logging.LogLevel, Microsoft.FSharp.Core.FSharpOption1<System.String>, Microsoft.FSharp.Core.FSharpFunc2<Expecto.TestCode,Expecto.SourceLocation>, Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1<Int32>, Boolean, Boolean, Boolean)’.

Steps:

Create a new expecto project

dotnet new expecto

Build the project

dotnet build

Build runs, does a restore, there are no errors.

Run the tests.

dotnet test

Get this error:

Starting test execution, please wait… An exception occurred while invoking executor ‘executor://yolodev/expecto’: Method not found: ‘Void ExpectoConfig…ctor(Boolean, Int32, Microsoft.FSharp.Core.FSharpOption1<System.TimeSpan>, System.TimeSpan, Double, Boolean, Microsoft.FSharp.Core.FSharpFunc2<Expecto.Test,Expecto.Test>, TestPrinters, Expecto.Logging.LogLevel, Microsoft.FSharp.Core.FSharpOption1<System.String>, Microsoft.FSharp.Core.FSharpFunc2<Expecto.TestCode,Expecto.SourceLocation>, Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1<Int32>, Boolean, Boolean, Boolean)’.

My dotnet --info

$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.2.105
 Commit:    7cecb35b92

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.2.105\

Host (useful for support):
  Version: 2.2.3
  Commit:  6b8ad509b6

.NET Core SDKs installed:
  2.1.300 [C:\Program Files\dotnet\sdk]
  2.1.403 [C:\Program Files\dotnet\sdk]
  2.1.505 [C:\Program Files\dotnet\sdk]
  2.2.101 [C:\Program Files\dotnet\sdk]
  2.2.105 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

I also reported this on the template project: https://github.com/MNie/Expecto.Template/issues/14

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
hafcommented, Apr 7, 2019

@MarneeDear Happy to have you as a user! I hope you can power through the SDK issue 😉

0reactions
MarneeDearcommented, Apr 7, 2019

I opened an issue with YoloDev. Looks like he has an idea of how to fix it.

https://github.com/YoloDev/YoloDev.Expecto.TestSdk/issues/15

Read more comments on GitHub >

github_iconTop Results From Across the Web

"dotnet build" succeeds to build but "dotnet test" fails ...
This means that you can build the project just fine, because SDK can be used to build any TFM (target framework). BUT then...
Read more >
'dotnet test' fails in docker build, runs fine otherwise
In my dockerfile, adding the command after the build command correctly calls to run the tests, but it fails.
Read more >
dotnet test command - .NET CLI
The dotnet test command is used to execute unit tests in a given project.
Read more >
Problems with .NET unit testing
Go to the directory with dotnet executable via terminal. Run "dotnet --version" command.
Read more >
Getting started: .NET Core with command line > xUnit.net
NET 5), showing you how to write and run your first set of unit tests. ... dotnet new xunit The template "xUnit Test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found