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.

Add support to net451 to dotnet-test-xunit

See original GitHub issue

I’m trying to run xUnit tests using dotnet test. I’m getting the following error: dotnet-test Error: 0 : System.InvalidOperationException: c:\Test\bin\Debug\dnx451\Test.dll\project.json does not exist. The tests work fine if run in Visual Studio using the Test Explorer.

Repro Steps

  1. Windows 8.1
  2. Install .NET CLI 1.0.1.001200 dev (from https://dotnet.github.io/getting-started/)
  3. Run the batch file below
  4. Update the project.json in the relevant step

repro.bat

cd c:\
mkdir Test
cd Test
dotnet new
echo Update project.json now to the provided project.json
start /wait notepad project.json
dotnet restore
dotnet build
dotnet test
pause

project.json

{
  "version": "1.0.0-*",
  "compilationOptions":
  {
    "emitEntryPoint": false
  },

  "dependencies":
  {
    "xunit": "2.1.0",
    "xunit.runner.dnx": "2.1.0-rc1-build204"
  },

  "commands":
  {
    "test": "xunit.runner.dnx"
  },

  "frameworks":
  {
    "dnx451":
    {
    }
  }
}

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
thecodejunkiecommented, May 21, 2016

@am11 @alberto-riggi

Note that dotnet-test-xunit has not landed on NuGet yet,

Not quite. The rc2 version, 1.0.0-rc2-build10015 can be found on NuGet https://www.nuget.org/packages/dotnet-test-xunit/1.0.0-rc2-build10015 but it contained a bug (https://github.com/xunit/xunit/issues/843) which had to be fixed and it’s the fixed version that is only available on MyGet at the moment

1reaction
alberto-riggicommented, May 20, 2016

It worked!

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add support to net451 to dotnet-test-xunit · Issue #5088
I'm trying to run xUnit tests using dotnet test. I'm getting the following error: dotnet-test Error: 0 : System.
Read more >
Running xunit.console on ASP.NET Core Targeting NET451
I've been building an ASP.NET Core library targeting NET451, DNX451 and DNXCORE50. In order to test the library, xUnit.net is used. Within ...
Read more >
Unit testing C# code in .NET Core using dotnet test and xUnit
Learn unit test concepts in C# and . ... Add the test project to the solution file by running the following command: .NET...
Read more >
Getting started: .NET Core with command line > xUnit.net
From the command line, create a folder for your test project, change into it, and then create the project using dotnet new :...
Read more >
Using dotnet watch test for continuous testing with .NET ...
Tests are run with dotnet test, not dotnet run. ... xUnit.net . ... I'll open my test project's project.json and add a reference...
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