From 779ecf86a556e88446cacd30a7421fa76451b838 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 5 May 2022 17:44:07 +0200 Subject: [PATCH 1/2] Downgrade xunit.runner.vs to net462 --- README.md | 6 +++--- src/xunit.runner.visualstudio/Constants.cs | 2 +- .../xunit.runner.visualstudio.csproj | 14 +++++++------- test/test.harness/test.harness.csproj | 2 +- .../test.testcasefilter/test.testcasefilter.csproj | 2 +- .../test.xunit.runner.visualstudio.csproj | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b1645ca5..bcbeaed7 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ To open an issue for this project, please visit the [core xUnit.net project issu ## Debugging -Debugging the VS Adapter is tricky. There are two ways to do it depending on whether you want to do it under `net472` or `netcoreapp3.1`. In all cases, you'll currently need to build your own test adapter NuGet package using `build.ps1`, `build.ps1 Packages` first to ensure you have local symbols. The symbols are not in the public package. It's helpful to add it to a local `\packages` directory and then use an entry like `` in your `NuGet.config` file to point to it. Don't forget to eventually delete it from your global profile `.nuget\packages\xunit...` when you're done. +Debugging the VS Adapter is tricky. There are two ways to do it depending on whether you want to do it under `net462` or `netcoreapp3.1`. In all cases, you'll currently need to build your own test adapter NuGet package using `build.ps1`, `build.ps1 Packages` first to ensure you have local symbols. The symbols are not in the public package. It's helpful to add it to a local `\packages` directory and then use an entry like `` in your `NuGet.config` file to point to it. Don't forget to eventually delete it from your global profile `.nuget\packages\xunit...` when you're done. -### `net472` +### `net462` Easiest thing to do is add a `launchSettings.json` file that adds the `vstest.console.exe` as a startup project and point it to an xunit dll. Something like the following (use `/listtests` if you just want to debug the discovery portion): ```json @@ -16,7 +16,7 @@ Easiest thing to do is add a `launchSettings.json` file that adds the `vstest.co "profiles": { "vstest console": { "executablePath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe", - "commandLineArgs": ".\\bin\\Debug\\net472\\Tests.System.Reactive.dll /TestAdapterPath:.\\bin\\Debug\\net472 /listtests", + "commandLineArgs": ".\\bin\\Debug\\net462\\Tests.System.Reactive.dll /TestAdapterPath:.\\bin\\Debug\\net462 /listtests", "workingDirectory": "C:\\dev\\RxNET\\Rx.NET\\Source\\Tests.System.Reactive\\" } } diff --git a/src/xunit.runner.visualstudio/Constants.cs b/src/xunit.runner.visualstudio/Constants.cs index c99c463b..cce11db1 100644 --- a/src/xunit.runner.visualstudio/Constants.cs +++ b/src/xunit.runner.visualstudio/Constants.cs @@ -2,7 +2,7 @@ { public static class Constants { -#if NET472 +#if NETFRAMEWORK public const string ExecutorUri = "executor://xunit/VsTestRunner2/net"; #elif WINDOWS_UAP public const string ExecutorUri = "executor://xunit/VsTestRunner2/uap"; diff --git a/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj index 5e80ca4d..d59c0f52 100644 --- a/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj +++ b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj @@ -6,7 +6,7 @@ xUnit.net Runner for Visual Studio ($(TargetFramework)) true Xunit.Runner.VisualStudio - net472;netcoreapp3.1;uap10.0.16299 + net462;netcoreapp3.1;uap10.0.16299 true Visual Studio 2019 16.8+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests. Supports .NET 4.7.2 or later, .NET Core 3.1 or later, and Universal Windows 10.0.16299 or later. @@ -20,7 +20,7 @@ 2.4.2-pre.12 - + xunit.runner.visualstudio.testadapter $(DefineConstants);NETFRAMEWORK @@ -42,18 +42,18 @@ @@ -81,7 +81,7 @@ Pack="true" /> - net472;net6.0 + net462;net6.0 diff --git a/test/test.testcasefilter/test.testcasefilter.csproj b/test/test.testcasefilter/test.testcasefilter.csproj index 44b3bd9c..447b5e78 100644 --- a/test/test.testcasefilter/test.testcasefilter.csproj +++ b/test/test.testcasefilter/test.testcasefilter.csproj @@ -1,7 +1,7 @@  - net472;net6.0 + net462;net6.0 diff --git a/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj b/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj index 526594fb..762dd837 100644 --- a/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj +++ b/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj @@ -1,7 +1,7 @@  - net472 + net462 @@ -11,7 +11,7 @@ - + From 93a0178595cf11b856b122e060c2e0313a2d5430 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 5 May 2022 17:52:33 +0200 Subject: [PATCH 2/2] Update xunit package version --- .../xunit.runner.visualstudio.csproj | 2 +- test/test.harness.uwp/test.harness.uwp.csproj | 2 +- test/test.harness/test.harness.csproj | 2 +- test/test.testcasefilter/test.testcasefilter.csproj | 2 +- .../test.xunit.runner.visualstudio.csproj | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj index d59c0f52..0a51a1fd 100644 --- a/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj +++ b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj @@ -17,7 +17,7 @@ 10.0.19041.0 xunit.runner.visualstudio - 2.4.2-pre.12 + 2.4.2-pre.22 diff --git a/test/test.harness.uwp/test.harness.uwp.csproj b/test/test.harness.uwp/test.harness.uwp.csproj index 936a6293..90995c65 100644 --- a/test/test.harness.uwp/test.harness.uwp.csproj +++ b/test/test.harness.uwp/test.harness.uwp.csproj @@ -111,7 +111,7 @@ - + 14.0 diff --git a/test/test.harness/test.harness.csproj b/test/test.harness/test.harness.csproj index cf6eb0e3..c59581a7 100644 --- a/test/test.harness/test.harness.csproj +++ b/test/test.harness/test.harness.csproj @@ -6,7 +6,7 @@ - + diff --git a/test/test.testcasefilter/test.testcasefilter.csproj b/test/test.testcasefilter/test.testcasefilter.csproj index 447b5e78..c07b737a 100644 --- a/test/test.testcasefilter/test.testcasefilter.csproj +++ b/test/test.testcasefilter/test.testcasefilter.csproj @@ -5,7 +5,7 @@ - + diff --git a/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj b/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj index 762dd837..029d181a 100644 --- a/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj +++ b/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj @@ -6,8 +6,8 @@ - - + +