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

Test debugging does not work on .NET Core 2.0 and xUnit 2.3.0 #1733

Closed
anfomin opened this issue Aug 23, 2017 · 16 comments · Fixed by #1749
Closed

Test debugging does not work on .NET Core 2.0 and xUnit 2.3.0 #1733

anfomin opened this issue Aug 23, 2017 · 16 comments · Fixed by #1749

Comments

@anfomin
Copy link

anfomin commented Aug 23, 2017

Environment data

dotnet --info output:

Программы командной строки .NET (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

VS Code version: 1.15.1
C# Extension version: 1.12.1
xUnit version: 2.3.0-beta4

Steps to reproduce

Create project with any xUnit test and click codelens "debug test" button.

Expected behavior

Test should be runned in debug mode.

Actual behavior

Exception message occurs:
An exception occurred while test discoverer 'VsTestRunner' was loading tests. Exception: Object reference not set to an instance of an object.

May be this is connected with this PR OmniSharp/omnisharp-roslyn#944? If so then may you update extension to include this fix?

@DustinCampbell
Copy link
Member

Yes, you're right that this was fixed recently in OmniSharp but that change has not made it into C# for VS Code yet. I'll keep this issue here until that happens and we have a new beta of C# for VS Code you can use.

@DustinCampbell
Copy link
Member

I've just taken a new version of OmniSharp that fixes this and created a new beta release: https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.13.0-beta1. You can following the instructions here to install the beta release.

@anfomin
Copy link
Author

anfomin commented Aug 31, 2017

@DustinCampbell thank you!

@anfomin
Copy link
Author

anfomin commented Sep 5, 2017

@DustinCampbell I've installed OmniSharp 1.13.0-beta1, but exception still appears on xUnit test debug:
An exception occurred while test discoverer 'VsTestRunner' was loading tests. Exception: Object reference not set to an instance of an object.

I'm using xUnit 2.3.0-beta5-build3769.

@DustinCampbell
Copy link
Member

Oop! I forgot to merge in the C# for VS Code side of this fix before creating the new beta. Will fix shortly.

@DustinCampbell
Copy link
Member

New day, new release. Please try C# for VS Code 1.13.0-beta2: https://github.com/OmniSharp/omnisharp-vscode/releases/tag/1.13.0-beta2.

@leechen
Copy link

leechen commented Oct 13, 2017

I still got the same error message after installed the vsix manually (1.13.0-beta2):

An exception occurred while test discoverer 'VsTestRunner' was loading tests. Exception: Object reference not set to an instance of an object.
Debugging complete.

@leechen
Copy link

leechen commented Oct 13, 2017

Might be related with the "Reload" icon. I did reload multiple times. Not sure why it is still there.

screen shot 2017-10-13 at 4 26 13 pm

@leechen
Copy link

leechen commented Oct 13, 2017

After uninstall 1.13.0-beta2 and reinstall manually, the "reload" icon is finally gone. The debug is working now.

@DustinCampbell
Copy link
Member

Glad to hear it's working for you now.

@johnnyreilly
Copy link

Just discovered this - I'm managing to debug in VS Code now 🍾 Do you happen to know when this might be released?

@DustinCampbell
Copy link
Member

We're aiming for a release by the end of the month.

@johnnyreilly
Copy link

Sweet - thanks!

@wadinj
Copy link

wadinj commented Oct 27, 2017

Great thread ! After 2 hours of googling I finally found it ! Thanks @DustinCampbell for the fix

@americofreitasjr
Copy link

americofreitasjr commented Nov 1, 2017

I'm having the same problem in vs-code on Ubuntu. Has this also been resolved? Thank you. See @asilferreira.

Option "debug test"
image

Error:
An exception occurred while test discoverer 'VsTestRunner' was loading tests. Exception: Object reference not set to an instance of an object.

Info:

xunit version 2.3.1

.NET Command Line Tools (2.0.0)

Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9

Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

@DustinCampbell
Copy link
Member

@americofreitasjr: Have you tried the latest C# for VS Code 1.13-beta5 release? You can follow the instructions here to install a beta release.

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