Skip to content

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

Closed
OmniSharp/omnisharp-roslyn
#1862
@benscabbia

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions