Skip to content

Instantly share code, notes, and snippets.

@parsalotfy
Created November 29, 2018 17:14
Show Gist options
  • Save parsalotfy/10a466c0681fc14bdd86debee7e9789d to your computer and use it in GitHub Desktop.
Save parsalotfy/10a466c0681fc14bdd86debee7e9789d to your computer and use it in GitHub Desktop.
VSCode launch configuration for building and testing csharp code by pressing F5
{
"version": "0.2.0",
"configurations": [
// Create a dotnet core class library named 'mylib' with pressing F5
{
"name": "Create_mylib",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": ["new","classlib","-o","mylib"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
},
// Configure F5 to build class library named 'mylib'
{
"name": "Build_mylib",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": ["build"],
"cwd": "${workspaceFolder}/mylib",
"console": "integratedTerminal"
},
// Create a dotnet core TEST class library named 'mytest' with pressing F5
{
"name": "Create_mytest",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": ["new","classlib","-o","mytest"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
},
// Configure F5 to build TEST class library named 'mytest'
{
"name": "Build_mytest",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": ["build"],
"cwd": "${workspaceFolder}/mytest",
"console": "integratedTerminal"
},
// Configure F5 to run all tests in test project named 'mytest'
{
"name": "Run_mytest",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": ["test"],
"cwd": "${workspaceFolder}/mytest",
"console": "integratedTerminal"
},
],
// First build the class library then run tests
"compounds": [
{
"name": "BuildAndTest",
"configurations": ["Build_mylib","Run_mytest"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment