Skip to content
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

VSCode "Error processing launch options at field: program" popup when debugging an xunit test #3459

Closed
benscabbia opened this issue Apr 29, 2018 · 17 comments · Fixed by OmniSharp/omnisharp-roslyn#1862
Labels

Comments

@benscabbia
Copy link

Steps to Reproduce:

  1. Setup a project with xunit:
    using System;
    using System.Reflection;
    using Xunit;
    
    public class Fact2Attribute : FactAttribute
    {
        public Fact2Attribute()
        {
            Type thisType = GetType();
             MethodInfo theMethod = thisType.GetMethod("MyOtherMethod");
             var result = theMethod.Invoke(this, null);
        }

            public void MyOtherMethod(string singleParam){}
    }
        [Fact2]
        public void ATestMethod()
        {           
            Assert.True(false);
        }
  1. Compile and using Code lens press Debug Test

Expected behavior

It should fail before the test runs as we are invoking MyOtherMethod without a param. An appropriate message should be shown.

Actual behavior

I get this window popup:
image

I don't get any error messages in console. If I try and run test rather than debug test it seems to completely bypass the test so I end up with:

Total tests: 0. Passed: 0. Failed: 0. Skipped: 0

If I run dotnet test I get the same result as run test in code lens.

Versions:

dotnet 2.1.105
VS code 1.22.2
Omisharp 1.14.0
Ubuntu 16.04.4 LTS

@ShaneGH
Copy link

ShaneGH commented Jun 9, 2019

Also experiencing this on windows using NUnit tests:

dotnet 2.2.103
VS code 1.35.0
Omnisharp: 1.19.1
Windows: 10.0.17134 Build 17134
NUnit3TestAdapter: 3.8.0
Microsoft.NET.Test.Sdk: 15.0.0
NUnit: 3.6.1

@filipw filipw transferred this issue from OmniSharp/omnisharp-roslyn Dec 12, 2019
@gregg-miskelly
Copy link
Contributor

@joelday
Copy link

joelday commented May 23, 2020

@gregg-miskelly Here's what came back for me, at least for nunit:

-> (C) {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code - Insiders","adapterID":"coreclr","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us","supportsProgressReporting":true},"type":"request","seq":1}
-> (C) {"command":"launch","arguments":{"logging":{"engineLogging":false},"type":"coreclr","name":".NET Test Launch","request":"launch","debuggerEventsPipeName":"/Users/joel.day/.vscode-insiders/extensions/ms-dotnettools.csharp-1.21.18/.TestDebugEvents-59853","program":null,"args":null,"cwd":"/Users/joel.day/external-projects/papyrus-lang","internalConsoleOptions":"openOnSessionStart","__sessionId":"7d2d4f12-d21d-4f71-9ebe-a15877244973"},"type":"request","seq":2}
<- (E) {"seq":3,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/CommandFailed","data":{"VS.Diagnostics.Debugger.vsdbg.AdditionalData":"program","VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.ErrorCode":1006,"VS.Diagnostics.Debugger.vsdbg.Command":"Launch","VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"19.4.0","VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"Darwin","VS.Diagnostics.Debugger.vsdbg.Version":"16.6.20415.1 commit:0184bb70e1ed40656c0dfa53125805036207007b","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Darwin"}}}
<- (R) {"seq":4,"type":"response","request_seq":2,"success":false,"command":"launch","message":"Error processing launch options at field: program"}

@joelday
Copy link

joelday commented May 23, 2020

OmniSharp tracing:

[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 208,
  "Command": "/v2/debugtest/getstartinfo",
  "Arguments": {
    "FileName": "/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Syntax/ScriptParserTest.cs",
    "MethodName": "DarkId.Papyrus.Test.LanguageService.Syntax.ScriptParserTest.Parser_ParsesScripts",
    "TestFrameworkName": "nunit",
    "TargetFrameworkVersion": ".NETCoreApp,Version=v3.0"
  }
[info]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestSession.Connected","Payload":null}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        send: {"MessageType":"ProtocolVersion","Payload":1}
[info]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"ProtocolVersion","Payload":1}
[info]: OmniSharp.DotNetTest.DebugSessionManager
        Debug session started.
[dbug]: OmniSharp.DotNetTest.VSTestManager
        send: {"MessageType":"TestDiscovery.Start","Payload":{"Sources":["/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"],"RunSettings":"\n<RunSettings>\n    <RunConfiguration>\n        <TargetFrameworkVersion>.NETCoreApp,Version=v3.0</TargetFrameworkVersion>\n    </RunConfiguration>\n</RunSettings>"}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestSession.Message","Payload":{"MessageLevel":0,"Message":"NUnit Adapter 3.16.1.0: Test discovery starting"}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestDiscovery.TestFound","Payload":[{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Program.ObjectIdentifierTests.ShouldBeEquatableWithCaseInsensitivity"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Program/ObjectIdentifierTests.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"ShouldBeEquatableWithCaseInsensitivity"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"d947bce0-03d8-f307-166f-bef6532d189c"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":38}]},{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Program.ObjectIdentifierTests.ShouldParseANamespacedScriptName"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Program/ObjectIdentifierTests.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"ShouldParseANamespacedScriptName"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"4c0708ea-2c73-4923-e37e-9af58f5b8424"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":21}]},{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Program.ObjectIdentifierTests.ShouldParseANamespacedScriptWithMemberName"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Program/ObjectIdentifierTests.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"ShouldParseANamespacedScriptWithMemberName"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"bf248e42-e6f0-2417-7f0d-e7d4589945f8"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":31}]},{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Program.ObjectIdentifierTests.ShouldParseAndConvertToAFilePath"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Program/ObjectIdentifierTests.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"ShouldParseAndConvertToAFilePath"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"b1233f00-7b55-3504-a1c0-fb10e420a1fc"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":53}]},{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Program.ObjectIdentifierTests.ShouldParseANonNamespacedScriptName"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Program/ObjectIdentifierTests.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"ShouldParseANonNamespacedScriptName"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"b053fb80-8a32-529c-1add-15e95eb8e45f"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":14}]},{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Program.ProgramTests(Fallout4).Program_ShouldResolveSources"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Program/ProgramTests.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"Program_ShouldResolveSources"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"2761e7b8-f0b6-24bc-cd96-2f95a1fb67fc"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":23}]},{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Program.ProgramTests(Skyrim).Program_ShouldResolveSources"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Program/ProgramTests.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"Program_ShouldResolveSources"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"64596e97-8885-2f0e-09ba-1ed778423c08"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":23}]},{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Syntax.ScriptLexerTest(Fallout4).Tokenize_ProducesTokensFromSourceText"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Syntax/ScriptLexerTest.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"Tokenize_ProducesTokensFromSourceText"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"f49c03ca-3a6d-c47b-7626-c25b8a14c88a"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":21}]},{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Syntax.ScriptLexerTest(Skyrim).Tokenize_ProducesTokensFromSourceText"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Syntax/ScriptLexerTest.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"Tokenize_ProducesTokensFromSourceText"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"d9d2796a-7dc5-c782-dfbe-495ad7100fcf"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":21}]},{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Syntax.ScriptParserTest(Fallout4).Parser_ParsesScripts"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Syntax/ScriptParserTest.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"Parser_ParsesScripts"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"25344e07-8984-ffa9-1fce-322bbf8d739a"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":22}]}]}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestSession.Message","Payload":{"MessageLevel":0,"Message":"NUnit Adapter 3.16.1.0: Test discovery complete"}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestDiscovery.TestFound","Payload":[{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"DarkId.Papyrus.Test.LanguageService.Syntax.ScriptParserTest(Skyrim).Parser_ParsesScripts"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://NUnit3TestExecutor"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/bin/Debug/netcoreapp3.0/DarkId.Papyrus.Test.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joel.day/external-projects/papyrus-lang/src/DarkId.Papyrus.Test/LanguageService/Syntax/ScriptParserTest.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"Parser_ParsesScripts"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"5d35fbe5-3f12-9f7f-2b2e-548c93d9b232"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":22}]}]}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestDiscovery.Completed","Payload":{"TotalTests":11,"LastDiscoveredTests":null,"IsAborted":false,"Metrics":{}}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        send: {"MessageType":"TestExecution.GetTestRunnerProcessStartInfoForRunSelected","Payload":{"TestCases":[],"DebuggingEnabled":true,"RunSettings":"\n<RunSettings>\n    <RunConfiguration>\n        <TargetFrameworkVersion>.NETCoreApp,Version=v3.0</TargetFrameworkVersion>\n    </RunConfiguration>\n</RunSettings>"}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestSession.Message","Payload":{"MessageLevel":2,"Message":"System.ArgumentException: The specified argument cannot be empty. (Parameter 'tests')\n   at Microsoft.VisualStudio.TestPlatform.ObjectModel.ValidateArg.NotNullOrEmpty[T](IEnumerable`1 arg, String parameterName)\n   at Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.TestRunCriteria..ctor(IEnumerable`1 tests, Int64 frequencyOfRunStatsChangeEvent, Boolean keepAlive, String testSettings, TimeSpan runStatsChangeEventTimeout, ITestHostLauncher testHostLauncher)\n   at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(TestRunRequestPayload testRunRequestPayload, ITestHostLauncher testHostLauncher, ITestRunEventsRegistrar testRunEventsRegistrar, ProtocolConfig protocolConfig)\n   at Microsoft.VisualStudio.TestPlatform.Client.DesignMode.DesignModeClient.<>c__DisplayClass21_0.<StartTestRun>b__0()"}}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 208,
  "Command": "/v2/debugtest/getstartinfo",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "FileName": null,
    "Arguments": null,
    "WorkingDirectory": null,
    "EnvironmentVariables": null
  },
  "Seq": 1478,
  "Type": "response"
}

@joelday
Copy link

joelday commented May 23, 2020

Looking at the fully qualified name, my guess would be that it is an issue with the fixture data I have applied to these tests:

    public class PerLanguageFixtureData : IEnumerable
    {
        public IEnumerator GetEnumerator()
        {
            yield return new TestFixtureData(new TestServiceInstance(LanguageVersion.Skyrim)
                .CreateProgram()).SetArgDisplayNames(nameof(LanguageVersion.Skyrim));

            yield return new TestFixtureData(new TestServiceInstance(LanguageVersion.Fallout4)
                .CreateProgram()).SetArgDisplayNames(nameof(LanguageVersion.Fallout4));
        }
    }

@joelday
Copy link

joelday commented May 23, 2020

Alright, at least in my case, this is covered by #1734.

@Vannevelj
Copy link

Vannevelj commented Jul 2, 2020

I've got the same issue. Log output

-> (C) {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"coreclr","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-gb","supportsProgressReporting":true},"type":"request","seq":1}
-> (C) {"command":"launch","arguments":{"logging":{"engineLogging":false},"type":"coreclr","name":".NET Test Launch","request":"launch","debuggerEventsPipeName":"/Users/jeroenvannevel/.vscode/extensions/ms-dotnettools.csharp-1.22.1/.TestDebugEvents-85294","program":null,"args":null,"cwd":"/Users/jeroenvannevel/Documents/source/fast-hls","internalConsoleOptions":"openOnSessionStart","__sessionId":"2b2186ee-bfad-4a76-9787-1625d97909ff"},"type":"request","seq":2}
<- (E) {"seq":3,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/CommandFailed","data":{"VS.Diagnostics.Debugger.vsdbg.AdditionalData":"program","VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.ErrorCode":1006,"VS.Diagnostics.Debugger.vsdbg.Command":"Launch","VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"19.5.0","VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"Darwin","VS.Diagnostics.Debugger.vsdbg.Version":"16.6.20415.1 commit:0184bb70e1ed40656c0dfa53125805036207007b","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Darwin"}}}
<- (R) {"seq":4,"type":"response","request_seq":2,"success":false,"command":"launch","message":"Error processing launch options at field: program"}

launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/fast-hls-tests/bin/Debug/net5.0/fast-hls-tests.dll",
            "args": [],
            "cwd": "${workspaceFolder}/fast-hls-tests",
            "console": "internalConsole",
            "stopAtEntry": false
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ]
}

Further system info:

jeroenvannevel@jheintzelman19l fast-hls % dotnet --info
.NET SDK (reflecting any global.json):
 Version:   5.0.100-preview.6.20318.15
 Commit:    4356580024

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.15
 OS Platform: Darwin
 RID:         osx.10.15-x64
 Base Path:   /usr/local/share/dotnet/sdk/5.0.100-preview.6.20318.15/

Host (useful for support):
  Version: 5.0.0-preview.6.20305.6
  Commit:  4ba9ecaabd

.NET SDKs installed:
  2.2.207 [/usr/local/share/dotnet/sdk]
  3.1.201 [/usr/local/share/dotnet/sdk]
  3.1.202 [/usr/local/share/dotnet/sdk]
  5.0.100-preview.6.20318.15 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.2.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0-preview.6.20312.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0-preview.6.20305.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

I've tried removing the launch.json and have it regenerate but no difference. I can confirm that the path used in program exists. Note that dotnet test and "Run test" both work. Switching to netcoreapp3.1 makes no difference.

@gregg-miskelly
Copy link
Contributor

gregg-miskelly commented Jul 3, 2020

@Vannevelj your problem isn't due to your launch.json file. This extension will attempt to create an in-memory json string to tell the debugger how to launch (see here). OmniSharp is failing to work out the path to the executable to launch. I don't know enough about the OmniSharp side to know if this is a bug in OmniSharp, a problem with your setup, or a problem with xunit --

From your log output:

(C) {"command":"launch","arguments":{"logging":{"engineLogging":false},"type":"coreclr","name":".NET Test Launch","request":"launch","debuggerEventsPipeName":"/Users/jeroenvannevel/.vscode/extensions/ms-dotnettools.csharp-1.22.1/.TestDebugEvents-85294","program":null,"args":null,"cwd":"/Users/jeroenvannevel/Documents/source/fast-hls","internalConsoleOptions":"openOnSessionStart","__sessionId":"2b2186ee-bfad-4a76-9787-1625d97909ff"},"type":"request","seq":2}

@jmezach
Copy link

jmezach commented Jul 6, 2020

I just ran into the same issue here. I'm wondering if this happens when the project containing the tests is multi-targeted. In my case it is targeting both net5.0 and netcoreapp3.1, so maybe that's why it isn't able to figure out which program to run? Actually I just tried changing the project to only target either net5.0 or netcoreapp3.1, but that didn't make a difference.

@vchirikov
Copy link

Now we have repro in #3901 , can anyone approve that debugging doesn't work there?

@JoeRobich
Copy link
Member

Repro from #3901:

Clone https://github.com/vchirikov/omnisharp_vscode_repro
Open in VS Code
Open UnitTest1.cs
Click on Debug test codelens link on UnitTest1.Test1

OmniSharp trace logging for the Debug Test request:

[info]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestSession.Connected","Payload":null}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        send: {"MessageType":"ProtocolVersion","Payload":1}
[info]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"ProtocolVersion","Payload":1}
[info]: OmniSharp.DotNetTest.DebugSessionManager
        Debug session started.
[dbug]: OmniSharp.DotNetTest.VSTestManager
        send: {"MessageType":"TestDiscovery.Start","Payload":{"Sources":["/Users/joeyrobichaud/Source/omnisharp_vscode_repro/artifacts/omnisharp-vscode-repro.dll"],"RunSettings":"\n<RunSettings>\n    <RunConfiguration>\n        <TargetFrameworkVersion>.NETCoreApp,Version=v3.1</TargetFrameworkVersion>\n    </RunConfiguration>\n</RunSettings>"}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestSession.Message","Payload":{"MessageLevel":0,"Message":"[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.1 (64-bit .NET Core 3.1.4)"}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestSession.Message","Payload":{"MessageLevel":0,"Message":"[xUnit.net 00:00:00.41]   Discovering: omnisharp-vscode-repro"}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestSession.Message","Payload":{"MessageLevel":0,"Message":"[xUnit.net 00:00:00.46]   Discovered:  omnisharp-vscode-repro"}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestDiscovery.TestFound","Payload":[{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"omnisharp_vscode_repro.UnitTest1.Test1"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://xunit/VsTestRunner2/netcoreapp"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joeyrobichaud/Source/omnisharp_vscode_repro/artifacts/omnisharp-vscode-repro.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joeyrobichaud/Source/omnisharp_vscode_repro/UnitTest1.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"omnisharp_vscode_repro.UnitTest1.Test1"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"59b97bed-adc2-eb3a-02dc-4b5f9bb224c5"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":10},{"Key":{"Id":"XunitTestCase","Label":"xUnit.net Test Case","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":":F:omnisharp_vscode_repro.UnitTest1:Test1:1:0:ed34c1d9dc01408382beebef7592a408"}]}]}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestDiscovery.Completed","Payload":{"TotalTests":1,"LastDiscoveredTests":null,"IsAborted":false,"Metrics":{}}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        send: {"MessageType":"TestExecution.GetTestRunnerProcessStartInfoForRunSelected","Payload":{"TestCases":[{"Properties":[{"Key":{"Id":"TestCase.FullyQualifiedName","Label":"FullyQualifiedName","Category":"","Description":"","Attributes":1,"ValueType":"System.String"},"Value":"omnisharp_vscode_repro.UnitTest1.Test1"},{"Key":{"Id":"TestCase.ExecutorUri","Label":"Executor Uri","Category":"","Description":"","Attributes":1,"ValueType":"System.Uri"},"Value":"executor://xunit/VsTestRunner2/netcoreapp"},{"Key":{"Id":"TestCase.Source","Label":"Source","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joeyrobichaud/Source/omnisharp_vscode_repro/artifacts/omnisharp-vscode-repro.dll"},{"Key":{"Id":"TestCase.CodeFilePath","Label":"File Path","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"/Users/joeyrobichaud/Source/omnisharp_vscode_repro/UnitTest1.cs"},{"Key":{"Id":"TestCase.DisplayName","Label":"Name","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":"omnisharp_vscode_repro.UnitTest1.Test1"},{"Key":{"Id":"TestCase.Id","Label":"Id","Category":"","Description":"","Attributes":1,"ValueType":"System.Guid"},"Value":"59b97bed-adc2-eb3a-02dc-4b5f9bb224c5"},{"Key":{"Id":"TestCase.LineNumber","Label":"Line Number","Category":"","Description":"","Attributes":1,"ValueType":"System.Int32"},"Value":10},{"Key":{"Id":"XunitTestCase","Label":"xUnit.net Test Case","Category":"","Description":"","Attributes":0,"ValueType":"System.String"},"Value":":F:omnisharp_vscode_repro.UnitTest1:Test1:1:0:ed34c1d9dc01408382beebef7592a408"}]}],"DebuggingEnabled":true,"RunSettings":"\n<RunSettings>\n    <RunConfiguration>\n        <TargetFrameworkVersion>.NETCoreApp,Version=v3.1</TargetFrameworkVersion>\n    </RunConfiguration>\n</RunSettings>"}}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        read: {"MessageType":"TestSession.Message","Payload":{"MessageLevel":0,"Message":"[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.1 (64-bit .NET Core 3.1.4)"}}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 68,
  "Command": "/v2/debugtest/getstartinfo",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
!    "FileName": null,
    "Arguments": null,
    "WorkingDirectory": null,
    "EnvironmentVariables": null,
    "Succeeded": true,
    "ContextHadNoTests": false,
    "FailureReason": null
  },
  "Seq": 471,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 70,
  "Command": "/v2/debugtest/stop",
  "Arguments": {
    "FileName": "/Users/joeyrobichaud/Source/omnisharp_vscode_repro/UnitTest1.cs"
  }
}
[dbug]: OmniSharp.DotNetTest.VSTestManager
        send: {"MessageType":"TestSession.Terminate","Payload":{}}
[info]: OmniSharp.DotNetTest.DebugSessionManager
        Debug session ended.
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 70,
  "Command": "/v2/debugtest/stop",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {},
  "Seq": 504,
  "Type": "response"
}

@IsmaelElias
Copy link

I've got the same issue. Log output:

-> (C) {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"coreclr","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"pt-br","supportsProgressReporting":true},"type":"request","seq":1}
-> (C) {"command":"launch","arguments":{"logging": {"engineLogging":false,"programOutput":true,"exceptions":true},"type":"coreclr","name":".NET Test Launch","request":"launch","debuggerEventsPipeName":"/home/ismael/.vscode/extensions/ms-dotnettools.csharp-1.22.1/.TestDebugEvents-2177","program":null,"args":null,"cwd":"/home/ismael/Documentos/Projetos/core-api","internalConsoleOptions":"openOnSessionStart","__sessionId":"d0c05174-18ec-4e3b-aaed-fc4a02214eef"},"type":"request","seq":2}
<- (E) {"seq":3,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/CommandFailed","data":{"VS.Diagnostics.Debugger.vsdbg.AdditionalData":"program","VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.ErrorCode":1006,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"linuxmint","VS.Diagnostics.Debugger.vsdbg.Command":"Launch","VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"19.2","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.6.20415.1 commit:0184bb70e1ed40656c0dfa53125805036207007b"}}}
<- (R) {"seq":4,"type":"response","request_seq":2,"success":false,"command":"launch","message":"Erro ao processar as opções de inicialização no campo: program"}

System info:
SDK do .NET Core (reflecting any global.json):
Version: 5.0.100-preview.6.20318.15
Commit: 4356580024

Ambiente de runtime:
OS Name: linuxmint
OS Version: 19.2
OS Platform: Linux
RID: linuxmint.19.2-x64
Base Path: /usr/share/dotnet/sdk/5.0.100-preview.6.20318.15/

Host (useful for support):
Version: 5.0.0-preview.6.20305.6
Commit: 4ba9ecaabd

.NET SDKs installed:
5.0.100-preview.6.20318.15 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0-preview.6.20312.15 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0-preview.6.20305.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

@onionhammer
Copy link

Seems like this should still be open - it's still an issue in 1.22.1 anyway.

@surenderssm
Copy link

Not sure why this is in closed state, as the issue persists in C# Extension: 1.22.1 (latest)
Closed status made me open similar issue - #3965

@JoeRobich - Any ETA on the release of this fix ? This just made me download VS 2019, just to run the unit tests !

@onionhammer
Copy link

This was fixed (for me) on Mac with the latest released beta

@surenderssm
Copy link

Not sure why this is in closed state, as the issue persists in C# Extension: 1.22.1 (latest)
Closed status made me open similar issue - #3965

@JoeRobich - Any ETA on the release of this fix ? This just made me download VS 2019, just to run the unit tests !

Update

I confirm it worked for me with C# Extension**: 1.23.0 , instructions to download beta helped !

@Ghostbird
Copy link

Version 1.23.0 fixed it for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.