简体   繁体   中英

Getting Debug Test option in code lens in VSCode for NUnit C#

"Run Test"/"Debug Test" is not showing up in Code Lens for a particular C# project. This particular project is using the NUnit test framework. I have another project using the xUnit framework in the same workspace and it has the options showing up. What can I do to get those same options in the xUnit test?

xUnit 测试显示运行测试/调试测试选项 NUnit 测试不显示运行测试/调试测试选项

Turns out I could get it to work by closing the workspace, then opening a new workspace with only this folder in it.

Alternately, at the bottom left of VSCode should show what project it currently has loaded (so nothing will show if Omnisharp is still loading itself). If the wrong project is loaded, you can click the name and select the correct one. Omnisharp should then load everything and the Code Lens should show up eventually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM