[英]In Visual Studio Code with C#, how do I run an NUnit test in Release mode?
您可以更改位於 .vscode 文件夾中的launch.json
文件中的配置。 運行測試的配置應如下所示:
{
"name": "Unit Tests",
"type": "dotnet",
"request": "launch",
"program": "${workspaceFolder}/bin/Debug/<YourProject>.dll",
"args": [
"--filter",
"cat==Unit"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
}
您需要更改"program":
字段的值以指向您項目的 DLL 文件的發布版本,例如:
"program": "${workspaceFolder}/bin/Release/<YourProject>.dll"
保存更改后,“運行測試”鏈接現在應該以發布模式運行它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.