6

I'm searching a way to debug my tests (mstest) .Net Core 2.0 in VSCode?

I didn't find nothing.

Thanks!

  • Does this approach work? https://stackoverflow.com/questions/45526413/how-do-i-do-i-execute-tests-in-debug-mode-using-net-core-and-vscode/45617472#45617472 – Wallace Kelly Sep 22 '17 at 18:42
  • Possible duplicate of [How does one debug an MSTest in VSCode?](https://stackoverflow.com/questions/47066356/how-does-one-debug-an-mstest-in-vscode) – granaker Nov 20 '17 at 22:04
  • Possible duplicate of [Debugging MSTest Unittests in VisualStudio Code](https://stackoverflow.com/questions/43210794/debugging-mstest-unittests-in-visualstudio-code) – Arghya C Nov 15 '18 at 18:58

3 Answers3

8

Already posted this answer in another thread. Re-posting as I found this thread earlier and thought there was no easy way.

If you are using the latest version of VS Code (I'm using v1.29.0), debugging (a) unit test is in-built feature.

*Make sure you have built the project so that tests appear correctly with all options.

enter image description here

Arghya C
  • 9,805
  • 2
  • 47
  • 66
0

enter image description here

I set this up by creating a small .bat, defining a VS Code task and a launch definition. Details here: How does one debug an MSTest in VSCode?

granaker
  • 1,318
  • 8
  • 13
  • You just posted part of your answer here. You should flag this post as duplicate if it match the other answer – Alon Eitan Nov 11 '17 at 20:13
  • @AlonEitan can't do that until the answer for the original question has been accepted/upvoted – granaker Nov 11 '17 at 20:17
  • Well OK, I retracted my "Not An Answer" flag, but please avoid posting duplicate answers in future because other users can still flag this types of answers and usually they get deleted by the community – Alon Eitan Nov 11 '17 at 20:20
-1

You can't, use Visual Studio Community Edition 2017, it is free. And will run your tests projects.

Visual Code is awesome, but it is not a full fledged software developer IDE, though it seems close sometimes.

It best to open your .NET Core projects in Visual Studio sometimes and sometimes just use Visual Code, just depends on what you are trying to do.

Brian Ogden
  • 18,439
  • 10
  • 97
  • 176
  • 1
    there are ways.. https://stackoverflow.com/questions/47066356/how-does-one-debug-an-mstest-in-vscode/47241515#47241515 – granaker Nov 11 '17 at 20:04