I'm trying to debug my .NET Core xUnit tests in VS 2017 RC. I run my tests via the Test Explorer window. While right-clicking a test and selecting Run Selected Tests works fine, selecting Debug Selected Tests does not:
I'm at a loss at how to get past this. I have tried restarting VS, doing a clean build, removing the .vs/
folder, and even updating to a newer build of VS 2017. However, nothing so far has worked. Does anyone have suggestions for how I can work around this? Thanks!
edit: My project has a Git repo here, so if you want to you're free to clone it and see if you can repro for yourself. The test assembly is in src/BasicCompiler.Tests/
.
In my case with Visual Studio 2017 release version the unit test project failed with this error because for some reason the unit test project had a launchsettings.json file under the project "properties" folder. Deleting it resolved the debugging issue.
Try running Visual Studio as an administrator, it might resolve the issue.
In case you don't know how: Right click on the application icon, right click on the applications name and select Run as Administrator.
If nothing helps try complete uninstall and reinstall of Visual Studio. Errors in upgrades cause issue sometimes. Ideally IDE should prompt errors and ask you to fix them but I have noticed Visual Studio does not do that; even when you go to updater and reinstall them.
I fixed this by updating Visual Studio 2017 to 15.9.6
Tools -> Extensions and Updates -> Updates.
Restarting vs worked for me...
User contributions licensed under CC BY-SA 3.0